Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session handling in struts.

 
Suhas Bilaye
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to figure out how I can set a session timeout in struts without using web.xml file. Is there any way where I can put a declarative global entry for session timeout in the struts config. Please suggest.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never seen such session time out configuration at Struts.xml. But why you need functionality. It's better define at web.xml
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nishan is correct--there's nothing for session handling in Struts. Sessions are handled by the container, not frameworks running in the container.
 
Suhas Bilaye
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply

Could you tell me if I have a session scope for one of the action mappings element in the struts config.
Then what will happen if session timeout occurs (web.xml) during the execution of that action?
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you are declaring Session time out Container consider your session idea time for time out your session.

For example if you set your Session time out 15 Min. And you session use in your action then it will not time out by container. But it last 15 Min your session not use your application then and then your that session time out.

If you are using Session at your action then this session not time out by container. It considers only Session idea time for time out.

So don't worry about declaring it in to Web.xml.
 
Suhas Bilaye
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic