How about a filter?

That is what I use.  Anything within a certain path first gets checked by my
filter and if the user doesn't have a valid session object it redirects them
to the login page...

This way the code doesn't even know it is happening...

You define one in your web.xml like so:
<filter>

<filter-name>SessionFilter</filter-name>

<filter-class>com.symbol.mc.oms.servlet.SessionFilter</filter-class>

</filter>



<filter-mapping>

<filter-name>SessionFilter</filter-name>

<url-pattern>/app/*</url-pattern>

</filter-mapping>



This way anything within the /app dir goes through the filter first...

----- Original Message ----- 
From: "Filip Polsakiewicz" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 8:12 AM
Subject: RE: Session expired


> My problem is, that I already have something around 60 jsps. Now it would
be
> nice to have a workaround so that i don't have to adapt all my jsps and
> actions.
>
> > -----Original Message-----
> > From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 19, 2003 12:58 PM
> > To: Struts Users Mailing List
> > Subject: Re: Session expired
> >
> >
> > What if you check from your action before redirecting to a  jsp ?
> >
> >
> > Filip Polsakiewicz wrote:
> >
> > >Hi,
> > >is there any way to redirect y user to a jsp if the session is expired
> > >without checking for an expired session within each single jsp?
> > >
> > >Thanks, Filip
> > >
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to