List of usage examples for org.apache.wicket.request.cycle RequestCycle find
@SuppressWarnings("unchecked") public <T extends IRequestHandler> Optional<T> find(final Class<T> type)
From source file:name.martingeisse.wicket.util.WicketPageUtil.java
License:Open Source License
/** * Redirects to a new instance of the current page class, with the current page * parameters. Useful to escape when stuck in a stateful page with outdated values. *//*from w w w. ja v a 2 s. c o m*/ public static void setResponsePageToNewPageInstance() { RequestCycle requestCycle = RequestCycle.get(); IPageClassRequestHandler requestHandler = requestCycle.find(IPageClassRequestHandler.class); if (requestHandler == null) { throw new IllegalStateException("no IPageClassRequestHandler found"); } requestCycle.setResponsePage(requestHandler.getPageClass(), requestHandler.getPageParameters()); }