aspose file tools*
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Strauts Application configuring front controller action