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

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


  {
    String expectedEncrypted = "?namedKey1=namedValue1";
    PageParameters expectedParameters = new PageParameters();
    expectedParameters.add("namedKey1", "namedValue1");

    RenderPageRequestHandler renderPageRequestHandler = new RenderPageRequestHandler(
      new PageProvider(tester.getApplication().getHomePage(), expectedParameters));
    Url url = mapper.mapHandler(renderPageRequestHandler);
    assertEquals(expectedEncrypted, url.toString());

    Request request = getRequest(url);
    IRequestHandler requestHandler = mapper.mapRequest(request);
    assertTrue(requestHandler instanceof RequestSettingRequestHandler);
    requestHandler = ((RequestSettingRequestHandler)requestHandler).getDelegateHandler();
    assertTrue(requestHandler instanceof RenderPageRequestHandler);

    RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;
    assertEquals(tester.getApplication().getHomePage(), handler.getPageClass());
    PageParameters actualParameters = handler.getPageParameters();
    assertEquals(expectedParameters, actualParameters);
  }
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

        pageUrl = requestCycle.urlFor(page.getClass(), page.getPageParameters());
        appendAssignment(buffer, "settings.ie8_src", pageUrl);
      }
      else
      {
        IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));

        pageUrl = requestCycle.urlFor(handler);
        String ie8_pageUrl = requestCycle.getUrlRenderer().renderRelativeUrl(
          requestCycle.mapUrlFor(handler));
        appendAssignment(buffer, "settings.ie8_src", ie8_pageUrl);
View Full Code Here

  private CharSequence renderPage(final Class<? extends Page> pageClass)
  {
    PageParameters parameters = new PageParameters();
    parameters.set("name", name);

    final RenderPageRequestHandler handler = new RenderPageRequestHandler(new PageProvider(
      pageClass, parameters), RedirectPolicy.NEVER_REDIRECT);

    final PageRenderer pageRenderer = getApplication().getPageRendererProvider().get(handler);

    RequestCycle requestCycle = getRequestCycle();
View Full Code Here

   * produced by it
   */
  @Test
  public void encrypt()
  {
    Url url = mapper.mapHandler(new RenderPageRequestHandler(new PageProvider(
      DummyHomePage.class, new PageParameters())));
    assertEquals(ENCRYPTED_URL, url.toString());
  }
View Full Code Here

    IRequestHandler requestHandler = mapper.mapRequest(request);
    assertThat(requestHandler, instanceOf(RequestSettingRequestHandler.class));
    requestHandler = ((RequestSettingRequestHandler)requestHandler).getDelegateHandler();
    assertThat(requestHandler, instanceOf(RenderPageRequestHandler.class));

    RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;
    assertEquals(DummyHomePage.class, handler.getPageClass());
  }
View Full Code Here

    IRequestHandler requestHandler = mapper.mapRequest(request);
    assertThat(requestHandler, instanceOf(RequestSettingRequestHandler.class));
    requestHandler = ((RequestSettingRequestHandler)requestHandler).getDelegateHandler();
    assertThat(requestHandler, instanceOf(RenderPageRequestHandler.class));

    RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;
    assertEquals(tester.getApplication().getHomePage(), handler.getPageClass());
    StringValue queryParam = handler.getPageParameters().get("named1");
    assertEquals("value1", queryParam.toOptionalString());
  }
View Full Code Here

    PageParameters expectedParameters = new PageParameters();
    expectedParameters.add("namedKey1", "namedValue1");
    expectedParameters.add("namedKey2", "namedValue2");
    expectedParameters.set(0, "indexedValue1");
    expectedParameters.set(1, "indexedValue2");
    RenderPageRequestHandler renderPageRequestHandler = new RenderPageRequestHandler(
      new PageProvider(DummyHomePage.class, expectedParameters));
    Url url = mapper.mapHandler(renderPageRequestHandler);
    // System.err.println(url.toString());
    assertEquals(expectedEncrypted, url.toString());

    Request request = getRequest(url);
    IRequestHandler requestHandler = mapper.mapRequest(request);
    assertThat(requestHandler, instanceOf(RequestSettingRequestHandler.class));
    requestHandler = ((RequestSettingRequestHandler)requestHandler).getDelegateHandler();
    assertThat(requestHandler, instanceOf(RenderPageRequestHandler.class));

    RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;
    assertEquals(DummyHomePage.class, handler.getPageClass());
    PageParameters actualParameters = handler.getPageParameters();
    assertEquals(expectedParameters, actualParameters);
  }
View Full Code Here

  {
    String expectedEncrypted = "?namedKey1=namedValue1";
    PageParameters expectedParameters = new PageParameters();
    expectedParameters.add("namedKey1", "namedValue1");

    RenderPageRequestHandler renderPageRequestHandler = new RenderPageRequestHandler(
      new PageProvider(tester.getApplication().getHomePage(), expectedParameters));
    Url url = mapper.mapHandler(renderPageRequestHandler);
    assertEquals(expectedEncrypted, url.toString());

    Request request = getRequest(url);
    IRequestHandler requestHandler = mapper.mapRequest(request);
    assertThat(requestHandler, instanceOf(RequestSettingRequestHandler.class));
    requestHandler = ((RequestSettingRequestHandler)requestHandler).getDelegateHandler();
    assertThat(requestHandler, instanceOf(RenderPageRequestHandler.class));

    RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;
    assertEquals(tester.getApplication().getHomePage(), handler.getPageClass());
    PageParameters actualParameters = handler.getPageParameters();
    assertEquals(expectedParameters, actualParameters);
  }
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

TOP

Related Classes of org.apache.wicket.core.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.