Package org.apache.wicket.core.request.handler

Examples of org.apache.wicket.core.request.handler.PageProvider


    parameters.set("b", "c");
    parameters.set("param1", "p1");
    parameters.set("param2", "p2");


    PageProvider provider = new PageProvider(MockPage.class, parameters);
    provider.setPageSource(context);
    IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
    Url url = placeholderEncoder.mapHandler(handler);
    assertEquals("some/p1/path/p2/i1/i2?a=b&b=c", url.toString());
  }
View Full Code Here


    parameters.set("a", "b");
    parameters.set("b", "c");
    parameters.set("param1", "p1");
    parameters.set("param2", "p2");

    PageProvider provider = new PageProvider(MockPage.class, parameters)
    {
      @Override
      public boolean isNewPageInstance()
      {
        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

   * WICKET-5247 page instantiated without required parameters won't be mapped
   */
  @Test
  public void placeholderEncode4()
  {
    PageProvider provider = new PageProvider(new MockPage())
    {
      @Override
      public boolean isNewPageInstance()
      {
        return false;
      }
    };
    provider.setPageSource(context);
    IRequestHandler handler = new RenderPageRequestHandler(provider);
    Url url = placeholderEncoder.mapHandler(handler);
    assertNull(url);
  }
View Full Code Here

    parameters.set("b", "c");
    parameters.set("param1", "p1");
    parameters.set("param2", "p2");


    PageProvider provider = new PageProvider(MockPage.class, parameters);
    provider.setPageSource(context);
    IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
    Url url = optionPlaceholderEncoder.mapHandler(handler);
    assertEquals("some/p1/path/p2/i1/i2?a=b&b=c", url.toString());
  }
View Full Code Here

    parameters.set("b", "c");
    parameters.set("param2", "p2");
    parameters.set("param3", "p3");


    PageProvider provider = new PageProvider(MockPage.class, parameters);
    provider.setPageSource(context);
    IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
    Url url = optionPlaceholderEncoder.mapHandler(handler);
    assertEquals("some/path/p2/p3/i1/i2?a=b&b=c", url.toString());
  }
View Full Code Here

   *
   * @param interceptPage
   */
  public RestartResponseAtInterceptPageException(Page interceptPage)
  {
    super(new RenderPageRequestHandler(new PageProvider(interceptPage),
      RedirectPolicy.AUTO_REDIRECT));
    InterceptData.set();
  }
View Full Code Here

   * @param parameters
   */
  public RestartResponseAtInterceptPageException(Class<? extends Page> interceptPageClass,
    PageParameters parameters)
  {
    super(new RenderPageRequestHandler(new PageProvider(interceptPageClass, parameters),
      RedirectPolicy.ALWAYS_REDIRECT));
    InterceptData.set();
  }
View Full Code Here

    if (shouldRedirectToPage(requestCycle))
    {
      // the page itself has been added to the request target, we simply issue a redirect
      // back to the page
      IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
      final String url = rc.urlFor(handler).toString();
      response.sendRedirect(url);
      return;
    }
View Full Code Here

   */
  @Test
  public void encode1()
  {
    MockPage page = new MockPage(15);
    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);

    Url url = encoder.mapHandler(handler);
    assertEquals("wicket/page?15", url.toString());
  }
View Full Code Here

   *
   */
  @Test
  public void encode1()
  {
    PageProvider provider = new PageProvider(MockPage.class, new PageParameters());
    provider.setPageSource(context);
    IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);
    assertEquals("wicket/bookmarkable/" + PAGE_CLASS_NAME, url.toString());
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.core.request.handler.PageProvider

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.