
com.databasesandlife.util.wicket.PageClassAndParameters Maven / Gradle / Ivy
package com.databasesandlife.util.wicket;
import org.apache.wicket.Page;
import org.apache.wicket.RestartResponseException;
import org.apache.wicket.request.mapper.parameter.PageParameters;
/**
* Wraps a page class and its parameters into one object.
*
* Wicket should have been shipped with a class like this.
* Passing two parameters to methods like "setResponsePage"
* is inelegant; and returning two parameters from a method is impossible.
*
* @author This source is copyright Adrian Smith and licensed under the LGPL 3.
* @see Project on GitHub
*/
public class PageClassAndParameters {
public final Class extends Page> page;
public final PageParameters params;
public PageClassAndParameters(Class extends Page> c, PageParameters p) { page=c; params=p; }
public void throwRestartResponseException() { throw new RestartResponseException(page, params); }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy