This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Servlets and the fly likes can anyone give me the session time out example code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "can anyone give me the session time out example code" Watch "can anyone give me the session time out example code" New topic
Author

can anyone give me the session time out example code

jayeshjayram khanvilkar
Greenhorn

Joined: Nov 06, 2005
Posts: 3
hi iam fresher
can anyone give me the session time out example code
thanks
jayesh
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What session timeout example code?
What are you trying to do?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by jayeshjayram khanvilkar:
hi iam fresher
can anyone give me the session time out example code
thanks
jayesh


u can use session.setTimeout();
or, else you can mention that into the web.xml of that application context.

cheers!


Rahul Bhattacharjee
LinkedIn - Blog
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by jayeshjayram khanvilkar:
hi iam fresher
can anyone give me the session time out example code
thanks
jayesh


u can use session.setTimeout();
or, else you can mention that into the web.xml of that application context.

cheers!
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Rahul Bhattacharjee:
u can use session.setTimeout();
or, else you can mention that into the web.xml of that application context.


We dont have such method. Please refer to the docs.
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
I think it's some setting in web.xml. Probably - session-config.


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Sunil Pradhan
Greenhorn

Joined: Nov 30, 2005
Posts: 15
Originally posted by jayeshjayram khanvilkar:
hi iam fresher
can anyone give me the session time out example code
thanks
jayesh


Hi,

You can do this in two ways
1. in your web.xml

<session-config>
<session-timeout>10</session-timeout>
</session-config>

2. in the servlet

session.setMaxInactiveInterval(600);

note :10 is in minute and 600 is in second

Cheers,

Sunil..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can anyone give me the session time out example code