import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.form.ListMultipleChoice;\r
-import org.apache.wicket.markup.html.form.StatelessForm;\r
import org.apache.wicket.markup.html.form.TextField;\r
import org.apache.wicket.markup.html.panel.Fragment;\r
import org.apache.wicket.markup.repeater.Item;\r
import com.gitblit.utils.ArrayUtils;\r
import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.GitBlitWebSession;\r
+import com.gitblit.wicket.SessionlessForm;\r
import com.gitblit.wicket.StringChoiceRenderer;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.panels.LinkPanel;\r
// search form\r
final Model<String> queryModel = new Model<String>(query);\r
final Model<ArrayList<String>> repositoriesModel = new Model<ArrayList<String>>(searchRepositories);\r
- StatelessForm<Void> form = new StatelessForm<Void>("searchForm") {\r
+ SessionlessForm<Void> form = new SessionlessForm<Void>("searchForm", getClass()) {\r
\r
private static final long serialVersionUID = 1L;\r
\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.form.DropDownChoice;\r
-import org.apache.wicket.markup.html.form.StatelessForm;\r
import org.apache.wicket.markup.html.form.TextField;\r
import org.apache.wicket.markup.html.link.ExternalLink;\r
import org.apache.wicket.markup.html.panel.Fragment;\r
import com.gitblit.wicket.GitBlitWebSession;\r
import com.gitblit.wicket.PageRegistration;\r
import com.gitblit.wicket.PageRegistration.OtherPageLink;\r
+import com.gitblit.wicket.SessionlessForm;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.panels.LinkPanel;\r
import com.gitblit.wicket.panels.NavigationPanel;\r
return WicketUtils.newObjectParameter(repositoryName, commitId);\r
}\r
\r
- private static class SearchForm extends StatelessForm<Void> implements Serializable {\r
+ private class SearchForm extends SessionlessForm<Void> implements Serializable {\r
private static final long serialVersionUID = 1L;\r
\r
private final String repositoryName;\r
Constants.SearchType.COMMIT);\r
\r
public SearchForm(String id, String repositoryName) {\r
- super(id);\r
+ super(id, RepositoryPage.this.getClass(), RepositoryPage.this.getPageParameters());\r
this.repositoryName = repositoryName;\r
DropDownChoice<Constants.SearchType> searchType = new DropDownChoice<Constants.SearchType>(\r
"searchType", Arrays.asList(Constants.SearchType.values()));\r
\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.form.PasswordTextField;\r
-import org.apache.wicket.markup.html.form.StatelessForm;\r
import org.apache.wicket.markup.html.form.TextField;\r
import org.apache.wicket.model.IModel;\r
import org.apache.wicket.model.Model;\r
import com.gitblit.wicket.GitBlitWebSession;\r
import com.gitblit.wicket.PageRegistration;\r
import com.gitblit.wicket.PageRegistration.DropDownMenuItem;\r
+import com.gitblit.wicket.SessionlessForm;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.panels.NavigationPanel;\r
\r
add(navPanel);\r
\r
// login form\r
- StatelessForm<Void> loginForm = new StatelessForm<Void>("loginForm") {\r
+ SessionlessForm<Void> loginForm = new SessionlessForm<Void>("loginForm", getClass(), getPageParameters()) {\r
\r
private static final long serialVersionUID = 1L;\r
\r
}\r
\r
if (!continueToOriginalDestination()) {\r
- // Redirect to home page\r
- setResponsePage(getApplication().getHomePage());\r
+ PageParameters params = getPageParameters();\r
+ if (params == null) {\r
+ // redirect to this page\r
+ setResponsePage(getClass());\r
+ } else {\r
+ // Strip username and password and redirect to this page\r
+ params.remove("username");\r
+ params.remove("password");\r
+ setResponsePage(getClass(), params);\r
+ }\r
}\r
}\r
}\r