You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pierre DEVREUX <me...@yahoo.fr> on 2009/11/29 09:39:56 UTC
Redirect to 401 page.
Hi as I've not found post dealing with my problem, I expose to you my
problem.
I have set my own contribution for PageRenderAccessHandler.
Before a page is displayed, I check in handle method, if user is
authenticated (call to my business layer).
If not, I would redirect user to page 401 (Unauthorized page), I won't
redirect to my own page 401, but to the one served by Tomcat.
How can I manage this ?
Thanks for you replies.
Pierre.
--
View this message in context: http://old.nabble.com/Redirect-to-401-page.-tp26560171p26560171.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Redirect to 401 page.
Posted by Pierre DEVREUX <me...@yahoo.fr>.
The problem is I check user authorization in my implementation of
PageRenderAccessFilter.
And the Dispatcher is called before in cycle life.
Then when dispatch method is called, check controls are not yet done.
--
View this message in context: http://old.nabble.com/Redirect-to-401-page.-tp26560171p26563306.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Redirect to 401 page.
Posted by Igor Drobiazko <ig...@gmail.com>.
You should contribute to a Dispatcher. Search the mailing list archive
or wiki.
29.11.2009, в 11:22, Pierre DEVREUX <me...@yahoo.fr> написал(а):
>
> Hi Ashwanth,
> thanks to reply so quickly
>
> In your reply, you define your own page Page_401.
> But what I would to do is that Tapestry gives back control to Tomcat
> to
> display such error page.
> In my mind, something like set in an HTTPResponse a status code
> 401, and
> that Tapestry lets Tomcat deals with it.
>
>
>
> Ashwanth Kumar wrote:
>>
>> Pierre,
>>
>> Wouldn't it as simple as this?
>>
>> Ur Page Code:
>>
>> @InjectPage
>> private Page401 user_err;
>>
>> ..........
>>
>> Object check_user() {
>> if(not authenticated) {
>> return user_err;
>> } else {
>> // continue processing the page, or just return null
>> }
>> }
>>
>> ........
>>
>> HTH
>> Ashwanth Kumar
>>
>>
>> On Sun, Nov 29, 2009 at 2:09 PM, Pierre DEVREUX <me...@yahoo.fr>
>> wrote:
>>
>>>
>>> Hi as I've not found post dealing with my problem, I expose to you
>>> my
>>> problem.
>>> I have set my own contribution for PageRenderAccessHandler.
>>> Before a page is displayed, I check in handle method, if user is
>>> authenticated (call to my business layer).
>>>
>>> If not, I would redirect user to page 401 (Unauthorized page), I
>>> won't
>>> redirect to my own page 401, but to the one served by Tomcat.
>>>
>>> How can I manage this ?
>>>
>>> Thanks for you replies.
>>>
>>> Pierre.
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Redirect-to-401-page.-tp26560171p26560171.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---
>>> ------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Redirect-to-401-page.-tp26560171p26560487.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: Redirect to 401 page.
Posted by Pierre DEVREUX <me...@yahoo.fr>.
Hi Ashwanth,
thanks to reply so quickly
In your reply, you define your own page Page_401.
But what I would to do is that Tapestry gives back control to Tomcat to
display such error page.
In my mind, something like set in an HTTPResponse a status code 401, and
that Tapestry lets Tomcat deals with it.
Ashwanth Kumar wrote:
>
> Pierre,
>
> Wouldn't it as simple as this?
>
> Ur Page Code:
>
> @InjectPage
> private Page401 user_err;
>
> ..........
>
> Object check_user() {
> if(not authenticated) {
> return user_err;
> } else {
> // continue processing the page, or just return null
> }
> }
>
> ........
>
> HTH
> Ashwanth Kumar
>
>
> On Sun, Nov 29, 2009 at 2:09 PM, Pierre DEVREUX <me...@yahoo.fr>
> wrote:
>
>>
>> Hi as I've not found post dealing with my problem, I expose to you my
>> problem.
>> I have set my own contribution for PageRenderAccessHandler.
>> Before a page is displayed, I check in handle method, if user is
>> authenticated (call to my business layer).
>>
>> If not, I would redirect user to page 401 (Unauthorized page), I won't
>> redirect to my own page 401, but to the one served by Tomcat.
>>
>> How can I manage this ?
>>
>> Thanks for you replies.
>>
>> Pierre.
>> --
>> View this message in context:
>> http://old.nabble.com/Redirect-to-401-page.-tp26560171p26560171.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
--
View this message in context: http://old.nabble.com/Redirect-to-401-page.-tp26560171p26560487.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Redirect to 401 page.
Posted by Ashwanth Kumar <as...@gmail.com>.
Pierre,
Wouldn't it as simple as this?
Ur Page Code:
@InjectPage
private Page401 user_err;
..........
Object check_user() {
if(not authenticated) {
return user_err;
} else {
// continue processing the page, or just return null
}
}
........
HTH
Ashwanth Kumar
On Sun, Nov 29, 2009 at 2:09 PM, Pierre DEVREUX <me...@yahoo.fr> wrote:
>
> Hi as I've not found post dealing with my problem, I expose to you my
> problem.
> I have set my own contribution for PageRenderAccessHandler.
> Before a page is displayed, I check in handle method, if user is
> authenticated (call to my business layer).
>
> If not, I would redirect user to page 401 (Unauthorized page), I won't
> redirect to my own page 401, but to the one served by Tomcat.
>
> How can I manage this ?
>
> Thanks for you replies.
>
> Pierre.
> --
> View this message in context:
> http://old.nabble.com/Redirect-to-401-page.-tp26560171p26560171.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>