Possible Duplicate:
Java page re-direct
I want to go to a certain page the first time it calls that page and go to another page all times after that while the session is is still active. I already have a login mechanism in place. I made another topic and was suggested to set a flag on the session layer. I’m not sure how to implement this.
Basically if when they press a button to go to a page it calls this:
public int show(Action action) throws Exception {
HttpServletRequest request = action.getRequest();
action.setJspURI("objects/objects_guidlines.jsp");
return FORWARD;
}
This is fine if they are coming here for the first time. How can I implement a check to see if this the first time or not and subsequently send to another page?
HTTP is a stateless protocol so if you want to maintain state between requests (such as whether the user has been here before), you’ll need to use something like cookies or sessions.
If you want to use the session, you can get it from the HttpServletRequest and do the following: