Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

read session timeout from web.xml

Thread view: 
Jim - 01 Nov 2006 00:10 GMT
How can I obtain the timeout value I set

 <session-config>
   <session-timeout>2</session-timeout>
 </session-config>

in my web.xml programatically in a servlet?

thanks

mark
WuyaSea Operator - 01 Nov 2006 00:22 GMT
I think it's one of ServletContext.getAttribute() or
ServletConfig.getInitParameter() , use getInitParameterNames() to get
all possible names.

see API doc http://java.sun.com/products/servlet/2.2/javadoc/

WuyaSea Operator
http://www.wuyaSea.com/board/280/java , answer question - earn cash.

> How can I obtain the timeout value I set
>
[quoted text clipped - 7 lines]
>
> mark
Wesley Hall - 01 Nov 2006 00:57 GMT
> How can I obtain the timeout value I set
>
[quoted text clipped - 3 lines]
>
> in my web.xml programatically in a servlet?

I believe the method getMaxInactiveInterval() on HttpSession will do
what you require.
Jim - 01 Nov 2006 08:35 GMT
> > How can I obtain the timeout value I set
> >
[quoted text clipped - 6 lines]
> I believe the method getMaxInactiveInterval() on HttpSession will do
> what you require.

Jim, getMaxInactiveInterval worked. Thanks


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.