Sorry for a question not directly related to struts.
My app is always enterred through login.do action, which authenticates
the user and sets a login bean in session attribute and returns some
forward based on user access level. However, when the forward page is
displayed (along with the list of session attributes), the login bean
is not there if the session has isNew()==true. If you hit reload, the
session.isNew()==false and the attribute appears. It seems that when
I store something in a new session and then do an internal forward,
the request in the second page doesn't have info about the session, and
all attributes are lost. Any idea how to fix this?
This is on Tomcat 3.2.1. Here is the action class's perform() method.
public ActionForward perform(ActionMapping mapping,
ActionForm
form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
String sKerberosID = request.getRemoteUser();
// create login bean for this user & this application
LoginBean login = new LoginBean( sKerberosID );
// store login bean as a session-scope bean
request.getSession().setAttribute( LoginBean.getKey(), login
);
return mapping.findForward( login.getSuperuser() ?
"superuser" : "success" );
}