You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Stefan Droog <sd...@educator.eu> on 2012/07/16 11:43:58 UTC
How to handle ReplaceHandlerException
Hi all,
The continueToOriginalDestination() method in our Login page throws a ReplaceHandlerException (Wicket 1.5.7). This means that it won't invoke the setResponsePage, which I do expect.
Our implementation looks like:
Form<Void> form = new StatelessForm<Void>("form"){
@Override
protected void onSubmit() {
if (session.signIn(username, password)) {
if (!continueToOriginalDestination()) {
setResponsePage(getApplication().getHomePage());
}
}
}
};
RequestHandlerStack#replaceAll throws this exception because there is still one requestHandler (ListenerInterfaceRequestHandler -> Listener interface: IFormSubmitListener).
How should we handle this exception?
Thanks in advance!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to handle ReplaceHandlerException
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
#continueToOriginalDestination() wont do anything if there is no saved
destination. In this case it will return false and your code will be
excuted (setResponsePage()).
On Mon, Jul 16, 2012 at 12:43 PM, Stefan Droog <sd...@educator.eu> wrote:
> Hi all,
>
> The continueToOriginalDestination() method in our Login page throws a ReplaceHandlerException (Wicket 1.5.7). This means that it won't invoke the setResponsePage, which I do expect.
>
> Our implementation looks like:
>
> Form<Void> form = new StatelessForm<Void>("form"){
>
> @Override
> protected void onSubmit() {
>
> if (session.signIn(username, password)) {
> if (!continueToOriginalDestination()) {
> setResponsePage(getApplication().getHomePage());
> }
> }
>
> }
> };
>
> RequestHandlerStack#replaceAll throws this exception because there is still one requestHandler (ListenerInterfaceRequestHandler -> Listener interface: IFormSubmitListener).
>
> How should we handle this exception?
>
> Thanks in advance!
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org