Re: Redirect not from onActivate

2010-02-24 Thread Alexander Kiel
> > For a beginner like me, it would be really nice if Tapestry had some > > lightweight annotations for authorization of pages, component visibility > > and events against some lightweight maybe only role based authentication > > service. > > Agreed. I may put something simple together for that

Re: Redirect not from onActivate

2010-02-24 Thread Howard Lewis Ship
On Wed, Feb 24, 2010 at 3:14 PM, Alexander Kiel wrote: >> > Well, because I want to redirect from other places in code, not from >> > onActivate() method. >> >> I think this is a good course. I think you'll find your pages more >> maintainable when you have this kind of organization in place. If y

Re: Redirect not from onActivate

2010-02-24 Thread Alexander Kiel
> > Well, because I want to redirect from other places in code, not from > > onActivate() method. > > I think this is a good course. I think you'll find your pages more > maintainable when you have this kind of organization in place. If you > have to get mid-way through processing or rendering the

Re: Redirect not from onActivate

2010-02-24 Thread Howard Lewis Ship
On Wed, Feb 24, 2010 at 2:24 PM, Algirdas wrote: > > Well, because I want to redirect from other places in code, not from > onActivate() method. I think this is a good course. I think you'll find your pages more maintainable when you have this kind of organization in place. If you have to get mid

Re: Redirect not from onActivate

2010-02-24 Thread Algirdas
Well, because I want to redirect from other places in code, not from onActivate() method. But I see now it should be possible to redesign a bit to achieve required redirect from onActivate(). -- View this message in context: http://n2.nabble.com/Redirect-not-from-onActivate-tp4627871p4629010.h

Re: Redirect not from onActivate

2010-02-24 Thread Alexander Kiel
Hi Algirdas, why do you want to use response.sendRedirect()? You can simply return a page class name. Tapestry always redirects. Regards Alex On Wed, 2010-02-24 at 13:06 -0800, Algirdas wrote: > Thank you all for suggestions. > > > It appears that I have to redesign some of page activation rou

Re: Redirect not from onActivate

2010-02-24 Thread Algirdas
Thank you all for suggestions. It appears that I have to redesign some of page activation routines. As for RedirectException, I'm afraid it will crash with the same NullPointerException, because it uses same response redirect as I use now: response.sendRedirect(pageLink.toRedirectURI()); al

Re: Redirect not from onActivate

2010-02-24 Thread Vassilis Bekiaris
Hi, I have seen a how-to on tapestry's wiki that describes how to implement a RedirectException which, when thrown from any part of your code, will perform a redirect (similar to the RedirectException that used to exist in Tapestry 4): http://wiki.apache.org/tapestry/Tapestry5RedirectException

Re: Redirect not from onActivate

2010-02-24 Thread Thiago H. de Paula Figueiredo
On Wed, 24 Feb 2010 16:11:18 -0300, Algirdas wrote: Hello, Hi! Is there any way to do a redirect from any method? Not out-of-the-box. For example I have EnsureUserLoggedIn() which should redirect to Login page, but this is called not in onActivate() method. onActivate() (or any metho

Re: Redirect not from onActivate

2010-02-24 Thread Alexander Kiel
Hi Algirdas, you can use the @OnEvent annotation with a value of "activate". For the redirect, you should simply return the class of the page. Regards Alex On Wed, 2010-02-24 at 11:11 -0800, Algirdas wrote: > Hello, > > Is there any way to do a redirect from any method? > > For example I have