• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to forward on session timed out in struts-config.xml

 
Alejandro Barrero
Ranch Hand
Posts: 335
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Browsing thru the Internet, it appears that it is possible to forward to a login page from the struts-config.xml file when the session times out. if this is possible, please tell me how to do it.

Alejandro Barrero
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if it's possible to do this entirely from entries in the struts-config.xml file, but I do like the approach suggested by Kevin H. Le in This Article from Java World.

I'd modify his approach somewhat, though. He suggests creating a base Action class with the login check. Now that we have a pluggable Request Processor in Struts 1.3.8, I'd suggest adding another command to the chain that handles the login check. That way you don't have to modify Action classes at all.
[ March 19, 2008: Message edited by: Merrill Higginson ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic