Package org.apache.wicket.request.handler

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


   *
   * @param pageClass
   */
  public void setResponsePage(Class<? extends IRequestablePage> pageClass)
  {
    IPageProvider provider = new PageProvider(pageClass, null);
    scheduleRequestHandlerAfterCurrent(new RenderPageRequestHandler(provider,
      RenderPageRequestHandler.RedirectPolicy.AUTO_REDIRECT));
  }
View Full Code Here


   * @param parameters
   */
  public void setResponsePage(Class<? extends IRequestablePage> pageClass,
    PageParameters parameters)
  {
    IPageProvider provider = new PageProvider(pageClass, parameters);
    scheduleRequestHandlerAfterCurrent(new RenderPageRequestHandler(provider,
      RenderPageRequestHandler.RedirectPolicy.AUTO_REDIRECT));
  }
View Full Code Here

    page.getPageParameters().set(1, "i2");
    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("a", "b");
    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
View Full Code Here

    MockPage page = new MockPage(15);
    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

   */
  public void testSetQueryParameterWhenRequestHasAnQueryUrl()
  {
    PageParameters parameters = new PageParameters();
    parameters.set("q_1", "q_1_value");
    IPageProvider testPageProvider = new PageProvider(MockPageParametersAware.class, parameters);
    IRequestHandler pageRequestHandler = new BookmarkablePageRequestHandler(testPageProvider);
    Url url = tester.getApplication().getRootRequestMapper().mapHandler(pageRequestHandler);
    tester.getRequest().setParameter("q_2", "q_2_value");
    tester.getRequest().setUrl(url);

View Full Code Here

  public void testSetMultiValueQueryParameter()
  {
    PageParameters parameters = new PageParameters();
    parameters.add("q_1", "q_1_value_1");
    parameters.add("q_1", "q_1_value_2");
    IPageProvider testPageProvider = new PageProvider(MockPageParametersAware.class, parameters);
    IRequestHandler pageRequestHandler = new BookmarkablePageRequestHandler(testPageProvider);
    Url url = tester.getApplication().getRootRequestMapper().mapHandler(pageRequestHandler);
    tester.getRequest().addParameter("q_2", "q_2_value_1");
    tester.getRequest().addParameter("q_2", "q_2_value_2");
    tester.getRequest().setUrl(url);
View Full Code Here

  @Test
  public void setQueryParameterWhenRequestHasAnQueryUrl()
  {
    PageParameters parameters = new PageParameters();
    parameters.set("q_1", "q_1_value");
    IPageProvider testPageProvider = new PageProvider(MockPageParametersAware.class, parameters);
    IRequestHandler pageRequestHandler = new BookmarkablePageRequestHandler(testPageProvider);
    Url url = tester.getApplication().getRootRequestMapper().mapHandler(pageRequestHandler);
    tester.getRequest().setParameter("q_2", "q_2_value");
    tester.getRequest().setUrl(url);
View Full Code Here

  public void setMultiValueQueryParameter()
  {
    PageParameters parameters = new PageParameters();
    parameters.add("q_1", "q_1_value_1");
    parameters.add("q_1", "q_1_value_2");
    IPageProvider testPageProvider = new PageProvider(MockPageParametersAware.class, parameters);
    IRequestHandler pageRequestHandler = new BookmarkablePageRequestHandler(testPageProvider);
    Url url = tester.getApplication().getRootRequestMapper().mapHandler(pageRequestHandler);
    tester.getRequest().addParameter("q_2", "q_2_value_1");
    tester.getRequest().addParameter("q_2", "q_2_value_2");
    tester.getRequest().setUrl(url);
View Full Code Here

   *
   * @param pageClass
   */
  public void setResponsePage(Class<? extends IRequestablePage> pageClass)
  {
    IPageProvider provider = new PageProvider(pageClass, null);
    scheduleRequestHandlerAfterCurrent(new RenderPageRequestHandler(provider,
      RenderPageRequestHandler.RedirectPolicy.AUTO_REDIRECT));
  }
View Full Code Here

TOP

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

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.