You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by James Howe <jw...@allencreek.com> on 2000/12/20 16:06:26 UTC
Page Forwarding Question
In my action classes I have code which checks to see if a user has logged
on. If not, the code forwards to the logon page (e.g.
servlet.findForward("logon")). However this doesn't fully accomplish what
I would like. If a user attempts to reference a page which requires a
login, I would like to forward to the login page and, once the user has
authenticated, proceed back to the page to which the user was going in the
first place. In other words, I would like to forward to the logon screen,
but give it a parameter which it uses to tell it which page follows the
logon. Can anyone suggest a simple way to accomplish this?
Thanks.
RE: Page Forwarding Question
Posted by Shiraz Wasim Zaidi <sw...@flash.net>.
> In my action classes I have code which checks to see if a user has logged
> on. If not, the code forwards to the logon page (e.g.
> servlet.findForward("logon")). However this doesn't fully
> accomplish what
> I would like. If a user attempts to reference a page which requires a
> login, I would like to forward to the login page and, once the user has
> authenticated, proceed back to the page to which the user was
> going in the
> first place. In other words, I would like to forward to the
> logon screen,
> but give it a parameter which it uses to tell it which page follows the
> logon. Can anyone suggest a simple way to accomplish this?
I think you might have problem using this approach if the session expires.
Let's say that a user's session expires due to time out and ur referenced
page relies on session data.
User was on Order List screen showing a list of orders. He goes for coffee
comes after an
hr. and session expires. He tries to view next page of Order List and in ur
action or JSP you detect
login required and forward to loginPage with somehow indicating to show
OrderList page after authentication.
Now ur OrderList jsp would be looking for session data to render the view
and it wont find anything as the
session is new.
What do you think?
-Shiraz