Package org.apache.wicket.request.handler

Examples of org.apache.wicket.request.handler.RenderPageRequestHandler


    else if (requestHandler instanceof RenderPageRequestHandler)
    {
      // possibly hybrid URL - bookmarkable URL with page instance information
      // but only allowed if the page was created by bookmarkable URL

      RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;

      if (!checkPageClass(handler.getPageClass()))
      {
        return null;
      }

      if (handler.getPageProvider().isNewPageInstance())
      {
        // no existing page instance available, don't bother creating new page instance
        PageInfo info = new PageInfo();
        UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(info, null),
          handler.getPageClass(), handler.getPageParameters());

        return buildUrl(urlInfo);
      }

      IRequestablePage page = handler.getPage();

      if (!pageMustHaveBeenCreatedBookmarkable() || page.wasCreatedBookmarkable())
      {
        PageInfo info = null;
        if (!page.isPageStateless())
        {
          info = new PageInfo(page.getPageId());
        }
        PageComponentInfo pageComponentInfo = info != null ? new PageComponentInfo(info,
          null) : null;

        UrlInfo urlInfo = new UrlInfo(pageComponentInfo, page.getClass(),
          handler.getPageParameters());
        return buildUrl(urlInfo);
      }
      else
      {
        return null;
      }

    }
    else if (requestHandler instanceof BookmarkableListenerInterfaceRequestHandler)
    {
      // listener interface URL with page class information
      BookmarkableListenerInterfaceRequestHandler handler = (BookmarkableListenerInterfaceRequestHandler)requestHandler;
      IRequestablePage page = handler.getPage();

      if (!checkPageClass(page.getClass()))
      {
        return null;
      }

      Integer renderCount = null;
      if (handler.getListenerInterface().isIncludeRenderCount())
      {
        renderCount = page.getRenderCount();
      }

      PageInfo pageInfo = new PageInfo(page.getPageId());
      ComponentInfo componentInfo = new ComponentInfo(renderCount,
        requestListenerInterfaceToString(handler.getListenerInterface()),
        handler.getComponent().getPageRelativePath(), handler.getBehaviorIndex());

      UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(pageInfo, componentInfo),
        page.getClass(), handler.getPageParameters());
      return buildUrl(urlInfo);
    }

    return null;
  }
View Full Code Here


    if (e instanceof StalePageException)
    {
      // If the page was stale, just rerender it
      // (the url should always be updated by an redirect in that case)
      return new RenderPageRequestHandler(new PageProvider(((StalePageException)e).getPage()));
    }
    else if (e instanceof PageExpiredException)
    {
      return createPageRequestHandler(new PageProvider(Application.get()
        .getApplicationSettings()
View Full Code Here

    if (isProcessingAjaxRequest())
    {
      redirect = RenderPageRequestHandler.RedirectPolicy.ALWAYS_REDIRECT;
    }

    return new RenderPageRequestHandler(pageProvider, redirect);
  }
View Full Code Here

    page.getPageParameters().set("a", "b");
    page.getPageParameters().set("b", "c");
    page.setCreatedBookmarkable(true);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);

    assertEquals("some/mount/path/i1/i2?15&a=b&b=c", url.toString());
  }
View Full Code Here

    page.getPageParameters().set("b", "c");

    page.setCreatedBookmarkable(false);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);

    // mounted pages must render mounted url even for page that has not been created by
    // bookmarkable
    // URL
View Full Code Here

    page.setBookmarkable(true);
    page.setCreatedBookmarkable(true);
    page.setPageStateless(true);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);

    Url url = encoder.mapHandler(handler);

    assertEquals("some/mount/path", url.toString());
  }
View Full Code Here

      {
        return false;
      }
    };
    provider.setPageSource(context);
    IRequestHandler handler = new RenderPageRequestHandler(provider);
    Url url = placeholderEncoder.mapHandler(handler);
    assertEquals("some/p1/path/p2/i1/i2?1&a=b&b=c", url.toString());
  }
View Full Code Here

    public IRequestHandler map(Exception e)
    {
      if (Exceptions.findCause(e, TestException.class) != null)
      {
        return new RenderPageRequestHandler(new PageProvider(TestExceptionPage.class));
      }
      return wrapped.map(e);
    }
View Full Code Here

    // should be null for Pages
    componentInPage = null;

    // prepare request
    request.setURL(request.getContextPath() + request.getServletPath() + "/");
    IRequestHandler handler = new RenderPageRequestHandler(pageProvider);

    // process request
    processRequest(request, handler);

    // The page rendered
View Full Code Here

        throw new WicketRuntimeException("Error creating page for modal dialog.");
      }
      // TODO (NG)
// RequestCycle.get().setUrlForNewWindowEncoding();

      IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
      appendAssignment(buffer, "settings.src", RequestCycle.get().urlFor(handler));
    }
    else
    {
      buffer.append("settings.element=element;\n");
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.handler.RenderPageRequestHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.