You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Shumbola (JIRA)" <ji...@apache.org> on 2007/05/10 20:01:24 UTC
[jira] Commented: (WICKET-497) For stateless mounted page incorrect
url is generated
[ https://issues.apache.org/jira/browse/WICKET-497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494803 ]
Shumbola commented on WICKET-497:
---------------------------------
Here is an example code, look for //*:
public final class SignIn extends WebPage
{
public SignIn()
{
add(new FeedbackPanel("feedback"));
add(new SignInForm("signInForm"));
}
public final class SignInForm extends StatelessForm
{
private final ValueMap properties = new ValueMap();
public SignInForm(final String id)
{
super(id);
add(new RequiredTextField("username", new PropertyModel(properties, "username")));
add(new PasswordTextField("password", new PropertyModel(properties, "password")));
}
public final void onSubmit()
{
if ( ("user".equals(properties.getString("username")) && "password".equals(properties.getString("password")))
{
if(session.isTemporary()) {
session.bind();
}
if (!continueToOriginalDestination())
{
RequestCycle.get().setRedirect(true);
setResponsePage(new Home()); //no matter using explicit redirect or not, this adds form listener to the URL
//* setResponsePage(Home.class); does work !!!
}
} else {
error("username or password wrong");
}
}
}
}
> For stateless mounted page incorrect url is generated
> -----------------------------------------------------
>
> Key: WICKET-497
> URL: https://issues.apache.org/jira/browse/WICKET-497
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3
> Environment: wicket-1.3.0-incubating-snapshot.jar from 21 Apr 2007
> Reporter: Shumbola
>
> There is no redirect by default if I use setResponsePage(new Home()) inside onSubmit() handler. If set redirect explicitly, after login from stateless SignIn page the url contains form submission listener. Example: http://localhost:8888/app/signin/wicket:interface/%3A0%3AsignInForm%3A%3AIFormSubmitListener%3A?wicket:interface=:1:::.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.