Re: problem with Session expiration in Struts



On Apr 25, 9:04 pm, ain...@xxxxxxxxx wrote:
You can use as well

request.getSession().setMaxInactiveInterval(600);

the method setMaxInactiveInterval from the class HttpSession.

But I have problem to forward after the session expiration.
After the expiration of the session, I can not forward to the login
page.
I have set the struts-config.xml for :
<global-forwards>
<forward name="welcome" path="/index.jsp"/>
</global-forwards>

but in my Action class :

AccountBean account = (AccountBean)
httpSession.getAttribute("accessToken");
if (account == null) {
//Session expired, go to login page.
target = "welcome";
return mapping.findForward(target);

}

gives nothing. The view, a .jsp page stays the same without any
reaction.
Anyone could help ?
Thanks

Have you got any solution for your problem?
If no,try this.
Instead of setting the forward action in the global forwards,try
setting it inside the same action tag.As an action can contain more
than one forwards,it should not give any problem.
<action >
<forward />
<forward name="welcome" path="/index.jsp"/>
</action>

regards,
vysh

.



Relevant Pages

  • Re: problem with Session expiration in Struts
    ... the method setMaxInactiveInterval from the class HttpSession. ... But I have problem to forward after the session expiration. ... AccountBean account = ...
    (comp.lang.java.programmer)
  • Re: problem with Session expiration in Struts
    ... the method setMaxInactiveInterval from the class HttpSession. ... But I have problem to forward after the session expiration. ... After the expiration of the session, I can not forward to the login ... AccountBean account = ...
    (comp.lang.java.programmer)