• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Validation for application having 1000 Action classes without redundant code in Actions?

 
praneeth gajji
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was asked in interview "We have developed application using struts having 1000 actions.Now we want to add code like whenever session expires redirect every action to single page,this needs to be done using struts framework instead of moving to every action class and edit them inorder to redirect to a page when session expires."

Please Help.Provide me answer to this question..Thanks in Advance
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not at all a great question I consider, You do it in interceptors if you were using Strtus2. Interceptors are triggered before (and/or) after hitting the action. In this scenario we will write an interceptor which take care identifying the whether user is having valid session or not. That's it. We can set session timeout in web.xml as well.
 
praneeth gajji
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply..

What can be done in case of struts 1.2 as I am using this in our project and also I dont have any idea of struts2.Session timeout is just for making session available for ample amount of time.Here I need to forward to specific JSp during session time out , how it can be done in struts1.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic