I am new to Struts so I have a simple question. On LoginAction.java I have used the following,
HttpSession session = request.getSession(true);
...
...
session.setAttribute(authuser.getSess_userid(), "userid");
session.setAttribute(authuser.getSess_username(), "username");
session.setAttribute(authuser.getSess_access(), "usertype");
return mapping.findForward(SUCCESS);
...
...
And on welcome.jsp,
<p> <bean:message key="title.welcome_en" /> <%=session.getAttribute("username").toString()%> </p>
However, I am getting NullPointException on welcome.jsp. What am I doing wrong???
Thank you.
It should be
http://download.oracle.com/javaee/5/api/javax/servlet/http/HttpSession.html#setAttribute(java.lang.String, java.lang.Object)