File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can anyone give me the session time out example code

 
jayeshjayram khanvilkar
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi iam fresher
can anyone give me the session time out example code
thanks
jayesh
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What session timeout example code?
What are you trying to do?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's some setting in web.xml. Probably - session-config.
 
Sunil Pradhan
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic