Thanks Martijn. This worked best: throw new RestartResponseAtInterceptPageException(LoginPage.class);
P On Thu, Jul 23, 2009 at 12:41 PM, Martijn Dashorst < martijn.dasho...@gmail.com> wrote: > throw new Redirect.....Exception() instead > > Martijn > > On Thu, Jul 23, 2009 at 11:44 AM, pieter claassen<pie...@claassen.co.uk> > wrote: > > Sorry, I sound illiterate to myself here. To start again, it seems that I > > cannot get redirectToInterceptPage to work correctly in my constructor > for > > the AuthPage class which all my pages inherit from. > > > > Any ideas on how to do this? I find using requestcycle's redirecTo to > tell > > me that I can only redirect a page once. Anyhow, I am sure that > redirectTo > > will not remember the redirector URL. > > > > Thanks > > Pieter > > > > On Thu, Jul 23, 2009 at 11:36 AM, pieter claassen <pie...@claassen.co.uk > >wrote: > > > >> What is the correct way to redirect to a login page from within a > >> constructor. This is wicket 1.3.5 and the code below just doesn't > redirect. > >> All my pages inherit from AuthPage(). > >> > >> public AuthPage() { > >> super(); > >> add(new MainMenuPanel("mainmenu", this)); > >> add(new FeedbackPanel("feedback")); > >> if (getUser() == null) { > >> redirectToInterceptPage(new LoginPage()); > >> } else { > >> authorized(); > >> add(new UserAdminPanel("adminpanel")); > >> } > >> } > >> > >> -- > >> Pieter Claassen > >> musmato.com > >> > > > > > > > > -- > > Pieter Claassen > > musmato.com > > > > > > -- > Become a Wicket expert, learn from the best: http://wicketinaction.com > Apache Wicket 1.3.5 is released > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Pieter Claassen musmato.com