Situation
I'm migrating a project from Wicket 1.5.7
to Wicket 6.12
, one of the errors I get is explained below.
Code
@Override
protected void onSubmit() {
final String usernameValue = mail.getModelObject();
//Password is left empty in this particular case
AuthenticatedWebSession.get().signIn(usernameValue,"");
if (!continueToOriginalDestination())
{
setResponsePage(getApplication().getHomePage());
}
}
Error
This is the error I got when changing wicket versions: The operator ! is undefined for the argument type(s) void
Note: I see this error when hovering over !continueToOriginalDestination
What did I try
In my search on stackoverflow I came accross this question: continueToOriginalDestination does not bring me back to originating page
Also checked this topic on apache wicket: http://apache-wicket.1842946.n4.nabble.com/Handling-ReplaceHandlerException-on-continueToOriginalDestination-in-wicket-1-5-td4101981.html#a4115437
So I changed my code to this:
@Override
public void onSubmit() {
final String usernameValue = mail.getModelObject();
AuthenticatedWebSession.get().signIn(usernameValue,"");
setResponsePage(getApplication().getHomePage());
throw new RestartResponseAtInterceptPageException(SignInPage.class);
}
Question
The old situation nor the code change seem to work in my particular case.
- Maybe it's a small change, is my new code wrong, how should this work?
- Has Wicket changed that much, so that the old code is not supported anymore, or can
!continueToOriginalDestination
be used as well?