Re: How to detect that session has expired ?

2003-12-07 Thread Thomas Cornet


  When a session restarts, its context is empty, so all objects stored in 
the session context have disappeared. To detect if a session has restarted, 
you need first to store an object in the session context, then each time 
you need to know if the session has restarted, you test its presence in the 
context. If it is not there anymore, then the session has restarted.

At 08:09 07/12/2003, you wrote:
Hi All,

How can I detect that session has expired and so throw the user out of
system after showing him a message that "Your session has expired. Please
login again."
Thanks,
BS
-
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]


RE: How to detect that session has expired ?

2003-12-07 Thread Baljinder Singh
Thomas,

You mean to say that I should put this logic in ActionClass. But then I
would need to put it in all my Action Classes. Can't I do something similar
in JSP because then I would do it in a common JSP which is included in all
other JSPs of mine. Or is there a common solution which can take care all
Action Classes.

Thanks,
BS

-Original Message-
From: Thomas Cornet [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 07, 2003 2:17 PM
To: Struts Users Mailing List
Subject: Re: How to detect that session has expired ?




   When a session restarts, its context is empty, so all objects stored in
the session context have disappeared. To detect if a session has restarted,
you need first to store an object in the session context, then each time
you need to know if the session has restarted, you test its presence in the
context. If it is not there anymore, then the session has restarted.

At 08:09 07/12/2003, you wrote:
>Hi All,
>
>How can I detect that session has expired and so throw the user out of
>system after showing him a message that "Your session has expired. Please
>login again."
>
>Thanks,
>BS
>
>
>-
>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]



Re: How to detect that session has expired ?

2003-12-07 Thread Mick
On Sun, 07 Dec 2003 12:39:46 +0530, Baljinder Singh wrote:
> How can I detect that session has expired and so throw the user out of
> system after showing him a message that "Your session has expired. Please
> login again."


javax.servlet.http.HttpSessionListener

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionListener.html
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Servlets4.html

You can listen to when the session is about to be destroyed.


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



RE: How to detect that session has expired ?

2003-12-07 Thread Mohan Radhakrishnan
Seems this is not supported by many containers yet(J2EE 1.4). You could use
a filter to check for session expiry but what if it expires after it passes
the filter. Then each JSP should have a check in the beginning.

Mohan

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Mick
Sent: Sunday, December 07, 2003 5:12 PM
To: [EMAIL PROTECTED]
Subject: Re: How to detect that session has expired ?


On Sun, 07 Dec 2003 12:39:46 +0530, Baljinder Singh wrote:
> How can I detect that session has expired and so throw the user out of
> system after showing him a message that "Your session has expired. Please
> login again."


javax.servlet.http.HttpSessionListener

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionListener
.html
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Servlets4.html

You can listen to when the session is about to be destroyed.


-
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]



Re: How to detect that session has expired ?

2003-12-07 Thread Ed Dowgiallo
Inheritance is your friend.  If you need processing common to all your
Action classes, extend the Struts Action class.

Ed
- Original Message -
From: "Baljinder Singh" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, December 07, 2003 5:41 AM
Subject: RE: How to detect that session has expired ?


> Thomas,
>
> You mean to say that I should put this logic in ActionClass. But then I
> would need to put it in all my Action Classes. Can't I do something
similar
> in JSP because then I would do it in a common JSP which is included in all
> other JSPs of mine. Or is there a common solution which can take care all
> Action Classes.
>
> Thanks,
> BS
>
> -Original Message-
> From: Thomas Cornet [mailto:[EMAIL PROTECTED]
> Sent: Sunday, December 07, 2003 2:17 PM
> To: Struts Users Mailing List
> Subject: Re: How to detect that session has expired ?
>
>
>
>
>When a session restarts, its context is empty, so all objects stored in
> the session context have disappeared. To detect if a session has
restarted,
> you need first to store an object in the session context, then each time
> you need to know if the session has restarted, you test its presence in
the
> context. If it is not there anymore, then the session has restarted.
>
> At 08:09 07/12/2003, you wrote:
> >Hi All,
> >
> >How can I detect that session has expired and so throw the user out of
> >system after showing him a message that "Your session has expired. Please
> >login again."
> >
> >Thanks,
> >BS
> >
> >
> >-
> >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]
>
>


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



Re: How to detect that session has expired ?

2003-12-07 Thread Ashish Kulkarni
HI
if u are using servelt 2.3 , then u can use servelt
filter, in this filter u can have logic to check
session before each request so u dont need to add any
code in jsp or action class

Ashish
--- Ed Dowgiallo <[EMAIL PROTECTED]> wrote:
> Inheritance is your friend.  If you need processing
> common to all your
> Action classes, extend the Struts Action class.
> 
> Ed
> - Original Message -
> From: "Baljinder Singh"
> <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> Sent: Sunday, December 07, 2003 5:41 AM
> Subject: RE: How to detect that session has expired
> ?
> 
> 
> > Thomas,
> >
> > You mean to say that I should put this logic in
> ActionClass. But then I
> > would need to put it in all my Action Classes.
> Can't I do something
> similar
> > in JSP because then I would do it in a common JSP
> which is included in all
> > other JSPs of mine. Or is there a common solution
> which can take care all
> > Action Classes.
> >
> > Thanks,
> > BS
> >
> > -----Original Message-----
> > From: Thomas Cornet [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, December 07, 2003 2:17 PM
> > To: Struts Users Mailing List
> > Subject: Re: How to detect that session has
> expired ?
> >
> >
> >
> >
> >When a session restarts, its context is empty,
> so all objects stored in
> > the session context have disappeared. To detect if
> a session has
> restarted,
> > you need first to store an object in the session
> context, then each time
> > you need to know if the session has restarted, you
> test its presence in
> the
> > context. If it is not there anymore, then the
> session has restarted.
> >
> > At 08:09 07/12/2003, you wrote:
> > >Hi All,
> > >
> > >How can I detect that session has expired and so
> throw the user out of
> > >system after showing him a message that "Your
> session has expired. Please
> > >login again."
> > >
> > >Thanks,
> > >BS
> > >
> > >
> >
>
>-
> > >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]
> >
> >
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



RE: How to detect that session has expired ?

2003-12-07 Thread Baljinder Singh
Ashish,

Can you provide me with more details about how to use Servlet Filter ?

Thanks,
BS

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 07, 2003 9:15 PM
To: Struts Users Mailing List
Subject: Re: How to detect that session has expired ?


HI
if u are using servelt 2.3 , then u can use servelt
filter, in this filter u can have logic to check
session before each request so u dont need to add any
code in jsp or action class

Ashish
--- Ed Dowgiallo <[EMAIL PROTECTED]> wrote:
> Inheritance is your friend.  If you need processing
> common to all your
> Action classes, extend the Struts Action class.
> 
> Ed
> - Original Message -
> From: "Baljinder Singh"
> <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> Sent: Sunday, December 07, 2003 5:41 AM
> Subject: RE: How to detect that session has expired
> ?
> 
> 
> > Thomas,
> >
> > You mean to say that I should put this logic in
> ActionClass. But then I
> > would need to put it in all my Action Classes.
> Can't I do something
> similar
> > in JSP because then I would do it in a common JSP
> which is included in all
> > other JSPs of mine. Or is there a common solution
> which can take care all
> > Action Classes.
> >
> > Thanks,
> > BS
> >
> > -----Original Message-----
> > From: Thomas Cornet [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, December 07, 2003 2:17 PM
> > To: Struts Users Mailing List
> > Subject: Re: How to detect that session has
> expired ?
> >
> >
> >
> >
> >When a session restarts, its context is empty,
> so all objects stored in
> > the session context have disappeared. To detect if
> a session has
> restarted,
> > you need first to store an object in the session
> context, then each time
> > you need to know if the session has restarted, you
> test its presence in
> the
> > context. If it is not there anymore, then the
> session has restarted.
> >
> > At 08:09 07/12/2003, you wrote:
> > >Hi All,
> > >
> > >How can I detect that session has expired and so
> throw the user out of
> > >system after showing him a message that "Your
> session has expired. Please
> > >login again."
> > >
> > >Thanks,
> > >BS
> > >
> > >
> >
>
>-
> > >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]
> >
> >
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-
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]



RE: How to detect that session has expired ?

2003-12-07 Thread Tim Lucia
You ought not to refer directly to any jsp pages anyway.  Always refer
to an action which forwards to your jsp.  Then you can put your JSPs
inside WEB-INF if you want (insures they can never be directly accessed)
and you never have to add any tag(s) to check for valid user.

As Ed points out, Inheritance is your friend.  Get to know him, and his
cousin, Poly.  Poly Morphism.

Tim Lucia

> -Original Message-
> From: Ashish Kulkarni [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, December 07, 2003 10:45 AM
> To: Struts Users Mailing List
> Subject: Re: How to detect that session has expired ?
> 
> 
> HI
> if u are using servelt 2.3 , then u can use servelt
> filter, in this filter u can have logic to check
> session before each request so u dont need to add any
> code in jsp or action class
> 
> Ashish
> --- Ed Dowgiallo <[EMAIL PROTECTED]> wrote:
> > Inheritance is your friend.  If you need processing
> > common to all your
> > Action classes, extend the Struts Action class.
> > 
> > Ed
> > - Original Message -
> > From: "Baljinder Singh" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List"
> > <[EMAIL PROTECTED]>
> > Sent: Sunday, December 07, 2003 5:41 AM
> > Subject: RE: How to detect that session has expired
> > ?
> > 
> > 
> > > Thomas,
> > >
> > > You mean to say that I should put this logic in
> > ActionClass. But then I
> > > would need to put it in all my Action Classes.
> > Can't I do something
> > similar
> > > in JSP because then I would do it in a common JSP
> > which is included in all
> > > other JSPs of mine. Or is there a common solution
> > which can take care all
> > > Action Classes.
> > >
> > > Thanks,
> > > BS
> > >
> > > -Original Message-
> > > From: Thomas Cornet [mailto:[EMAIL PROTECTED]
> > > Sent: Sunday, December 07, 2003 2:17 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: How to detect that session has
> > expired ?
> > >
> > >
> > >
> > >
> > >When a session restarts, its context is empty,
> > so all objects stored in
> > > the session context have disappeared. To detect if
> > a session has
> > restarted,
> > > you need first to store an object in the session
> > context, then each time
> > > you need to know if the session has restarted, you
> > test its presence in
> > the
> > > context. If it is not there anymore, then the
> > session has restarted.
> > >
> > > At 08:09 07/12/2003, you wrote:
> > > >Hi All,
> > > >
> > > >How can I detect that session has expired and so
> > throw the user out of
> > > >system after showing him a message that "Your
> > session has expired. Please
> > > >login again."
> > > >
> > > >Thanks,
> > > >BS
> > > >
> > > >
> > >
> >
> >-
> > > >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]
> > >
> > >
> > 
> > 
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing. 
http://photos.yahoo.com/

-
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]



Re: How to detect that session has expired ?

2003-12-08 Thread Kirk Wylie
Ashish Kulkarni wrote:

HI
if u are using servelt 2.3 , then u can use servelt
filter, in this filter u can have logic to check
session before each request so u dont need to add any
code in jsp or action class
If he's using Servlet 2.3, then he can also use the 
ServletContextListener in conjunction, where is where the logic for 
whether the session has been restarted could likely belong.

Kirk Wylie
M7 Corporation
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: How to detect that session has expired ?

2003-12-08 Thread Edgar P Dollin
If you use container authentication or filters, this isn't an issue.  The
user will never get to an action class with an invalid session.

Edgar

-Original Message-
From: Kirk Wylie [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2003 1:19 PM
To: Struts Users Mailing List
Subject: Re: How to detect that session has expired ?


Ashish Kulkarni wrote:

> HI
> if u are using servelt 2.3 , then u can use servelt
> filter, in this filter u can have logic to check
> session before each request so u dont need to add any
> code in jsp or action class

If he's using Servlet 2.3, then he can also use the 
ServletContextListener in conjunction, where is where the logic for 
whether the session has been restarted could likely belong.

Kirk Wylie
M7 Corporation

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



Re: How to detect that session has expired ?

2003-12-09 Thread Curtis Taylor
HttpSessionListener is your friend...;-)

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html

Kirk Wylie wrote:

Ashish Kulkarni wrote:

HI
if u are using servelt 2.3 , then u can use servelt
filter, in this filter u can have logic to check
session before each request so u dont need to add any
code in jsp or action class


If he's using Servlet 2.3, then he can also use the 
ServletContextListener in conjunction, where is where the logic for 
whether the session has been restarted could likely belong.

Kirk Wylie
M7 Corporation
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
c dot tee at verizon dot net
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to detect that session has expired ?

2003-12-10 Thread Kirk Wylie
D'oh! That's the one I ment, not ServletContextListener.

Kirk "Must proofread before sending" Wylie
M7 Corporation
Curtis Taylor wrote:

HttpSessionListener is your friend...;-)

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html 

Kirk Wylie wrote:

 > Ashish Kulkarni wrote:
 >
 >> HI
 >> if u are using servelt 2.3 , then u can use servelt
 >> filter, in this filter u can have logic to check
 >> session before each request so u dont need to add any
 >> code in jsp or action class
 >
 >
 > If he's using Servlet 2.3, then he can also use the
 > ServletContextListener in conjunction, where is where the logic for
 > whether the session has been restarted could likely belong.
 >
 > Kirk Wylie
 > M7 Corporation
 >
 > -
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]
 >
 >
--
c dot tee at verizon dot net
-
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]