wood burning stoves 2.0*
The moose likes Struts and the fly likes Strauts Application configuring front controller action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Strauts Application configuring front controller action" Watch "Strauts Application configuring front controller action" New topic
Author

Strauts Application configuring front controller action

Chhaya Patil
Greenhorn

Joined: Nov 14, 2008
Posts: 17
Hi,

In our application we are facing problem when user's session times out / user logs out and then try to access any random action. What i mean to say is, we have a start action which finds out user role and access level. but if the application is directly accessed without calling start action then we obviously get errors.

What is the way of forcefully calling the start action even though user accidently tried to access any other action.
(this may happen when someone bookmarks any action instead of actual application URL)

Thanks.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Save the requested action, redirect them to the login page, and send them back to the saved action.
Chhaya Patil
Greenhorn

Joined: Nov 14, 2008
Posts: 17
The user is sent to log in page if sesion timed out. But what happens is directly the last action (action in URL) is accessed. Since i have lost valuable information from sesion, error occurs.

This can be avoided if whatever is URL, after logged in the Start action is called and Homepage is diaplyed, it's acceptable.

I can do a quick check in every action, if session variabes are null then to redirect to start but i am looking for a better solution.

Thanks.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If your application requires recovering from a lost session at *any* point in workflow then you'd need to consider persisting session data in a database and restoring it on login.

Checking for a valid session data can be done in either an action superclass that all your other actions extend or in a custom request processor (S1.2) or whatever the equivalent is in S1.3.

If neither of those two options seems like what you're asking about then you'll have to be a bit more specific.
 
Don't get me started about those stupid light bulbs.
 
subject: Strauts Application configuring front controller action
 
Similar Threads
How to Show the ProgressBar in the browser when i am doing Complex Operation on server
LDAP authentication + filter + redirect = mess
War file not working fine in websphere but working fine in other server(jetty)
Actionforward url
Session duplicated