Search in sources :

Example 11 with IPageRequestHandler

use of org.apache.wicket.core.request.handler.IPageRequestHandler in project wicket by apache.

the class PageInstanceMapperTest method decode8.

/**
 */
@Test(expected = StalePageException.class)
public void decode8() {
    Url url = Url.parse("wicket/page?4-6.5-a-b-c");
    context.setNextPageRenderCount(8);
    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    ((IPageRequestHandler) handler).getPage();
}
Also used : IRequestHandler(org.apache.wicket.request.IRequestHandler) IPageRequestHandler(org.apache.wicket.core.request.handler.IPageRequestHandler) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Example 12 with IPageRequestHandler

use of org.apache.wicket.core.request.handler.IPageRequestHandler in project wicket by apache.

the class DefaultExceptionMapper method extractCurrentPage.

/**
 * @return the page being rendered when the exception was thrown, or {@code null} if it cannot
 *         be extracted
 */
protected Page extractCurrentPage() {
    final RequestCycle requestCycle = RequestCycle.get();
    IRequestHandler handler = requestCycle.getActiveRequestHandler();
    if (handler == null) {
        handler = requestCycle.getRequestHandlerScheduledAfterCurrent();
    }
    if (handler instanceof IPageRequestHandler) {
        IPageRequestHandler pageRequestHandler = (IPageRequestHandler) handler;
        return (Page) pageRequestHandler.getPage();
    }
    return null;
}
Also used : IRequestHandler(org.apache.wicket.request.IRequestHandler) RequestCycle(org.apache.wicket.request.cycle.RequestCycle) IPageRequestHandler(org.apache.wicket.core.request.handler.IPageRequestHandler) ExceptionErrorPage(org.apache.wicket.markup.html.pages.ExceptionErrorPage)

Example 13 with IPageRequestHandler

use of org.apache.wicket.core.request.handler.IPageRequestHandler in project wicket-orientdb by OrienteerBAP.

the class OrientDefaultExceptionsHandlingListener method extractCurrentPage.

private Page extractCurrentPage(boolean fullSearch) {
    final RequestCycle requestCycle = RequestCycle.get();
    IRequestHandler handler = requestCycle.getActiveRequestHandler();
    if (handler == null) {
        handler = requestCycle.getRequestHandlerScheduledAfterCurrent();
        if (handler == null && fullSearch) {
            handler = OrientDbWebApplication.get().getRootRequestMapper().mapRequest(requestCycle.getRequest());
        }
    }
    if (handler instanceof IPageRequestHandler) {
        IPageRequestHandler pageRequestHandler = (IPageRequestHandler) handler;
        return (Page) pageRequestHandler.getPage();
    }
    return null;
}
Also used : IRequestHandler(org.apache.wicket.request.IRequestHandler) RequestCycle(org.apache.wicket.request.cycle.RequestCycle) IRequestCycle(org.apache.wicket.request.IRequestCycle) IPageRequestHandler(org.apache.wicket.core.request.handler.IPageRequestHandler) Page(org.apache.wicket.Page)

Aggregations

IPageRequestHandler (org.apache.wicket.core.request.handler.IPageRequestHandler)13 IRequestHandler (org.apache.wicket.request.IRequestHandler)11 Url (org.apache.wicket.request.Url)9 Test (org.junit.Test)9 IRequestablePage (org.apache.wicket.request.component.IRequestablePage)6 Request (org.apache.wicket.request.Request)5 RequestCycle (org.apache.wicket.request.cycle.RequestCycle)3 Page (org.apache.wicket.Page)2 ArcAdapter (de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.ArcAdapter)1 FeatureSupportRegistry (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupportRegistry)1 AnnotatorState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState)1 VArc (de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VArc)1 VComment (de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VComment)1 VCommentType (de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VCommentType)1 VDocument (de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VDocument)1 TypeUtil (de.tudarmstadt.ukp.clarin.webanno.api.annotation.util.TypeUtil)1 WebAnnoCasUtil.getAddr (de.tudarmstadt.ukp.clarin.webanno.api.annotation.util.WebAnnoCasUtil.getAddr)1 WebAnnoCasUtil.selectByAddr (de.tudarmstadt.ukp.clarin.webanno.api.annotation.util.WebAnnoCasUtil.selectByAddr)1 AnnotationFeature (de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature)1 ArrayList (java.util.ArrayList)1