You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by wkm <wk...@zanoccio.com> on 2011/04/05 04:42:37 UTC
[tapestry-security] Redirecting to original page after login
Hi,
I've been very much enjoying using tapestry-security.
I can't seem to figure out how to redirect to the original page, after
log-in, however.
I've played around with various settings for SecuritySymbols.ON_SUCCESS,
but that configures the landing page and seems to be independent of the
page requiring the actual login.
I've tried injecting the Session and using #getPath() in #onSucess() on
the login page, but that gives the path to the form submit .
The annoying part is it seems like it should be trivial, since the
original URL is still shown in the browser (chrome, safari, firefox).
I did write my own LoginPage for appearance reasons. Perhaps this was a
Bad Idea?
Thanks for your help,
Wiktor
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [tapestry-security] Redirecting to original page after login
Posted by wkm <wk...@zanoccio.com>.
Hi Alejandro,
I did indeed create my own login form.
But the code you sent works perfectly, thank you very much.
Wiktor
On 4/5/2011 3:08 AM, Alejandro Scandroli wrote:
> Hi Wiktor
>
> This is the default behavior in the LoginForm component, are you using
> <t:security.loginform /> or did you write your own login form too?
> If that's the case, you could be missing these lines:
>
> SavedRequest savedRequest =
> WebUtils.getAndClearSavedRequest(requestGlobals.getHTTPServletRequest());
> response.sendRedirect(savedRequest.getRequestUrl());
>
> Take a look at the LoginForm source code:
> http://svn.tynamo.codehaus.org/browse/tynamo/trunk/tapestry-security/src/main/java/org/tynamo/security/components/LoginForm.java?r=HEAD#l112
>
> Cheers.
> Alejandro.
>
> On Tue, Apr 5, 2011 at 4:42 AM, wkm<wk...@zanoccio.com> wrote:
>> Hi,
>>
>> I've been very much enjoying using tapestry-security.
>>
>> I can't seem to figure out how to redirect to the original page, after
>> log-in, however.
>>
>> I've played around with various settings for SecuritySymbols.ON_SUCCESS, but
>> that configures the landing page and seems to be independent of the page
>> requiring the actual login.
>>
>> I've tried injecting the Session and using #getPath() in #onSucess() on the
>> login page, but that gives the path to the form submit .
>>
>> The annoying part is it seems like it should be trivial, since the original
>> URL is still shown in the browser (chrome, safari, firefox).
>>
>>
>> I did write my own LoginPage for appearance reasons. Perhaps this was a Bad
>> Idea?
>>
>> Thanks for your help,
>>
>> Wiktor
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [tapestry-security] Redirecting to original page after login
Posted by Alejandro Scandroli <al...@gmail.com>.
Hi Wiktor
This is the default behavior in the LoginForm component, are you using
<t:security.loginform /> or did you write your own login form too?
If that's the case, you could be missing these lines:
SavedRequest savedRequest =
WebUtils.getAndClearSavedRequest(requestGlobals.getHTTPServletRequest());
response.sendRedirect(savedRequest.getRequestUrl());
Take a look at the LoginForm source code:
http://svn.tynamo.codehaus.org/browse/tynamo/trunk/tapestry-security/src/main/java/org/tynamo/security/components/LoginForm.java?r=HEAD#l112
Cheers.
Alejandro.
On Tue, Apr 5, 2011 at 4:42 AM, wkm <wk...@zanoccio.com> wrote:
> Hi,
>
> I've been very much enjoying using tapestry-security.
>
> I can't seem to figure out how to redirect to the original page, after
> log-in, however.
>
> I've played around with various settings for SecuritySymbols.ON_SUCCESS, but
> that configures the landing page and seems to be independent of the page
> requiring the actual login.
>
> I've tried injecting the Session and using #getPath() in #onSucess() on the
> login page, but that gives the path to the form submit .
>
> The annoying part is it seems like it should be trivial, since the original
> URL is still shown in the browser (chrome, safari, firefox).
>
>
> I did write my own LoginPage for appearance reasons. Perhaps this was a Bad
> Idea?
>
> Thanks for your help,
>
> Wiktor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org