You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shiraz Wasim Zaidi <sw...@flash.net> on 2000/06/21 01:47:12 UTC

RE: 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?

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