You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Morten Andersen <mo...@mip.sdu.dk> on 2003/09/17 01:09:10 UTC

re-invoke request after authentication

I've implemented my own authentication mechanism using Struts and it works 
fine, but I have to use the request.attributes instead of 
request.getParameters because the parameterMap is immutable.

Another way i'm thinking about is to redirect the user to the restricted 
action after login.

So that the following happens:

The user request an action that requires login.
If the user is not logged in, then he is sent to a login-page.
He fills in the login-form.
The login-form content is sent to the login action.
If he may enter, then he is sent to the page that he initially required, 
with all the information he tryed to sent in the first place.

So I need to write a string with all the information, that the user sent in 
the first place, so that I can write something like:

<body onload="location.href='<bean:write name="oldRequestWithAllParameters" 
/>' >

Is there an easy way of implementing that?


Morten Andersen
Master of applied mathematics and computer science
Research assistant (in e-learning)

The Maersk Institute of Production technology at Southern Danish University 
www.mip.sdu.dk
Campusvej 55
DK-5230 Odense M
Denmark
+45 6550-3654
+45 6171-1103
Jabber id: hat@jabber.dk

Re: re-invoke request after authentication

Posted by Daniel Wang <dd...@anomaly.net>.
If you simply do a

return mapping.findForward( new ActionForward("foo.do") );

your request will be forwarded to the new action with the existing
ServletRequest object in tact.  i.e. everything will just work.

daniel

----- Original Message ----- 
From: "Morten Andersen" <mo...@mip.sdu.dk>
To: <st...@jakarta.apache.org>
Sent: Tuesday, September 16, 2003 4:09 PM
Subject: re-invoke request after authentication


> I've implemented my own authentication mechanism using Struts and it works
> fine, but I have to use the request.attributes instead of
> request.getParameters because the parameterMap is immutable.
>
> Another way i'm thinking about is to redirect the user to the restricted
> action after login.
>
> So that the following happens:
>
> The user request an action that requires login.
> If the user is not logged in, then he is sent to a login-page.
> He fills in the login-form.
> The login-form content is sent to the login action.
> If he may enter, then he is sent to the page that he initially required,
> with all the information he tryed to sent in the first place.
>
> So I need to write a string with all the information, that the user sent
in
> the first place, so that I can write something like:
>
> <body onload="location.href='<bean:write
name="oldRequestWithAllParameters"
> />' >
>
> Is there an easy way of implementing that?
>
>
> Morten Andersen
> Master of applied mathematics and computer science
> Research assistant (in e-learning)
>
> The Maersk Institute of Production technology at Southern Danish
University
> www.mip.sdu.dk
> Campusvej 55
> DK-5230 Odense M
> Denmark
> +45 6550-3654
> +45 6171-1103
> Jabber id: hat@jabber.dk
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org