wood burning stoves 2.0*
The moose likes Struts and the fly likes Session Validation for application having 1000 Action classes without redundant code in Actions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Session Validation for application having 1000 Action classes without redundant code in Actions?" Watch "Session Validation for application having 1000 Action classes without redundant code in Actions?" New topic
Author

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

praneeth gajji
Greenhorn

Joined: Apr 12, 2012
Posts: 24
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

Joined: Aug 01, 2007
Posts: 485

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.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
praneeth gajji
Greenhorn

Joined: Apr 12, 2012
Posts: 24
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Validation for application having 1000 Action classes without redundant code in Actions?