You can use tokens to flag valid submissions. See the Struts JavaDocs for Action.isTokenValid(), Action.saveToken(), Action.resetToken(). See also this article
Here's the logic:
if (!isTokenValid(request)) { return mapping.findForward("home"); // where "home" is a global forward }
You might also check for some object in the session scope that indicate that a user has properly logged in to the application. If the object is not there, you'd forward to the home page. [ November 30, 2004: Message edited by: Junilu Lacar ]
You probably want to do it in a Filter so that you don't have to change much code in all Actions.
Tony Yan<br /> <br />IBM Certified Developer XML and Related Technology<br />Sun Certified Web Component Developer For J2EE Platform<br />Sun Certified Programmer For Java 2 Platform
Clifford Adams
Ranch Hand
Joined: May 12, 2004
Posts: 50
posted
0
Can you give an example of doing this in a filter? I haven't used them before.