You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vishnu Vyasan Nelliparmbil <vi...@MUN.GOV.BH> on 2009/08/29 08:33:42 UTC

How to handle a Session Timeout using struts 1.3?

Hi Friends,

 

How can I forward to a login page on session Timeout?  Will struts
create a Default session?

 

I am checking for a value of a locale variable set to default session on
my JSP page. After   

 

   if(request.getSession(false).getAttribute("locale") == null){

 

//redirect to another page

}

 

But this is some how not working and after a session time out when I am
trying to access the locale variable its giving a null pointer
exception.

 

Regards

Vishnu Nv


Re: How to handle a Session Timeout using struts 1.3?

Posted by sharadsingh <sh...@gmail.com>.
instead of just providing 

if(request.getSession(false).getAttribute("locale") == null)

provide

if(request.getSession(false) == null ||
request.getSession(false).getAttribute("locale") == null) {
  //redirect
}

i hope this will work

vishnu.vyasan wrote:
> 
> Hi Friends,
> 
>  
> 
> How can I forward to a login page on session Timeout?  Will struts
> create a Default session?
> 
>  
> 
> I am checking for a value of a locale variable set to default session on
> my JSP page. After   
> 
>  
> 
>    if(request.getSession(false).getAttribute("locale") == null){
> 
>  
> 
> //redirect to another page
> 
> }
> 
>  
> 
> But this is some how not working and after a session time out when I am
> trying to access the locale variable its giving a null pointer
> exception.
> 
>  
> 
> Regards
> 
> Vishnu Nv
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-handle-a-Session-Timeout-using-struts-1.3--tp25200423p25200496.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org