Multiple session-timeout (web.xml) configurations within a WAR
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Nic_Daniau
Posted On:   Tuesday, December 17, 2002 02:12 AM

Hello, In a WAR, the element: 2 is located below the root element in web.xml. A consequence of this, unless I'm greatly mistaken, is that there can only be one value of session timeout accross the whole WAR. I'm working on a web application using Struts / Struts sub-applications (1.1B2). Sub-applications allows for a web app to be split and configured in chunks, allowing for a sub-application to deal with an aspect of a system, another sub-application with another. Rapidily comes the need to allow for different session timeout for each part of the WAR. Is there a way to do that in this context? If not (what I fear), what would you advise?    More>>

Hello,


In a WAR, the element:

			

2


is located below the root element in web.xml.


A consequence of this, unless I'm greatly mistaken, is that there can only be one value of session timeout accross the whole WAR.


I'm working on a web application using Struts / Struts sub-applications (1.1B2). Sub-applications allows for a web app to be split and configured in chunks, allowing for a sub-application to deal with an aspect of a system, another sub-application with another.


Rapidily comes the need to allow for different session timeout for each part of the WAR. Is there a way to do that in this context? If not (what I fear), what would you advise?


Thanks for all your enlightning ideas!


Nick

   <<Less

Re: Multiple session-timeout (web.xml) configurations within a WAR

Posted By:   michael_dean  
Posted On:   Monday, December 30, 2002 02:24 PM

The element is used to specify the default timeout for sessions in a web application. The developer can change the timeout for some, all, or none of the sessions (to the same or different values) using setMaxInactiveInterval(int) method of the object implementing HttpSession. Note, however, that the value specified in web.xml is in minutes and the value specified in setMaxInactiveInterval(int) is in seconds.



If you don't want to set the timeout depending on which part of the application the user is currently in (which could be easily implemented with Filters), you could break the application into different web applications (contexts). Note, however, that if this is done, each user will have a different session for each context he/she has entered (thus more server overhead, difficulty in sharing information across contexts, etc.).

About | Sitemap | Contact