Could I use RestartResponseException to redirect to a URL instead of a 
bookmarkable page?

My problem is that all of my pages require a parameter (even the home page but 
that's fine because the Tomcat container server.xml configures the appropriate 
redirection for me - users never have to enter the parameters in the address 
bar) but the "Expired Page" page contains a link that does not contain any 
parameters.

When a session expires the page that appears attempts to go to the 'home' page 
without any parameters. If I could either change the expired page's link or do 
a redirect in the home page's constructor that redirect's to "/" then this 
would work fine.

Unfortunately the RestartResponseException seems to only want to redirect to 
bookmarkable pages. Is there an alternative I could use to redirect to the "/" 
URL?

> -----Original Message-----
> From: Martin Asenov [mailto:mase...@velti.com]
> Sent: Friday, 5 February 2010 12:30 AM
> To: users@wicket.apache.org
> Subject: RE: setResponsePage in the beggining of a constructor does not
> work
> 
> Thanks friend! Works great! You saved me a lot of time!
> 
> Best regards,
> Martin
> 
> -----Original Message-----
> From: Major Péter [mailto:majorpe...@sch.bme.hu]
> Sent: Thursday, February 04, 2010 3:21 PM
> To: users@wicket.apache.org
> Subject: Re: setResponsePage in the beggining of a constructor does not
> work
> 
> Hi,
> 
> the setresponsepage only marks, that the pagetarget is something else on
> the end of the cycle, but it isn't stopping the execution of the current
> page. If you want that, then use:
> throw new RestartResponseException(getApplication().getHomePage());
> 
> Regards,
> Peter
> 
> 2010-02-04 14:16 keltezéssel, Martin Asenov írta:
> > Hello guys!
> >
> > I've got three pages, where I do certain check in the beginning and if
> the criteria is not met, I redirect to home page. I make it that way:
> >
> > public MyPageClass {
> >
> >             if (something) {
> >                         system.out.println("mypageclass - we're in");
> >                         setResponsePage(getApplication().getHomePage());
> >             }
> >
> > .... page initialization afterwards
> > }
> >
> > The strange thing is that it works for one of the pages, for another two
> - it does not - there is no redirection at all; it goes on with further
> initializing. The criteria check block is the very same one in each of the
> pages.
> >
> > Appreciate if someone helps!
> >
> > Regards,
> > Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to