List of usage examples for org.apache.wicket.core.request.handler IPageRequestHandler isPageInstanceCreated
boolean isPageInstanceCreated();
From source file:com.github.javawithmarcus.wicket.cdi.ConversationPropagator.java
License:Apache License
/** * Resolves a page instance from the request handler iff the page instance is already created * * @param handler/* www .j av a 2 s .co m*/ * @return page or {@code null} if none */ public static Page getPage(IRequestHandler handler) { while (handler instanceof IRequestHandlerDelegate) { handler = ((IRequestHandlerDelegate) handler).getDelegateHandler(); } if (handler instanceof IPageRequestHandler) { IPageRequestHandler pageHandler = (IPageRequestHandler) handler; if (pageHandler.isPageInstanceCreated()) { return (Page) pageHandler.getPage(); } } return null; }
From source file:de.flapdoodle.wicket.request.cycle.RequestCyclePageExceptionListener.java
License:Apache License
@Override public IRequestHandler onException(RequestCycle cycle, Exception ex) { IPageRequestHandler latestPageRequestHandler = getLastHandler(cycle); if (latestPageRequestHandler != null) { if (latestPageRequestHandler.isPageInstanceCreated()) { return _pageExceptionListener.onException(cycle, ex, latestPageRequestHandler.getPage()); } else {// w w w. ja v a2 s . c om return _pageExceptionListener.onException(cycle, ex, latestPageRequestHandler.getPageClass()); } } return super.onException(cycle, ex); }