Package org.apache.wicket.request

Examples of org.apache.wicket.request.Url

The Url class takes care of encoding and decoding of the segments and parameters. @author Matej Knopp @author Igor Vaynberg

   *
   */
  @Test
  public void decode2()
  {
    Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/indexed1?a=b&b=c");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof RenderPageRequestHandler);
    IRequestablePage page = ((RenderPageRequestHandler)handler).getPage();
    assertEquals(PAGE_CLASS_NAME, page.getClass().getName());
View Full Code Here


   *
   */
  @Test
  public void decode3()
  {
    Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME + "?15");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof RenderPageRequestHandler);
    IRequestablePage page = ((RenderPageRequestHandler)handler).getPage();
    checkPage(page, 15);
View Full Code Here

   *
   */
  @Test
  public void decode4()
  {
    Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/i1/i2?15&a=b&b=c");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof RenderPageRequestHandler);
    IRequestablePage page = ((RenderPageRequestHandler)handler).getPage();
    checkPage(page, 15);
View Full Code Here

   *
   */
  @Test
  public void decode5()
  {
    Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME + "?15-ILinkListener-foo-bar");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);

    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;
View Full Code Here

   *
   */
  @Test
  public void decode6()
  {
    Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME +
      "/i1/i2?15-ILinkListener-foo-bar&a=b&b=c");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);
    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;
View Full Code Here

   *
   */
  @Test
  public void decode7()
  {
    Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME +
      "?15-ILinkListener.4-foo-bar");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);

View Full Code Here

   *
   */
  @Test
  public void decode8()
  {
    Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME +
      "/i1/i2?15-5.ILinkListener-foo-bar&a=b&b=c");

    context.setNextPageRenderCount(5);

    IRequestHandler handler = encoder.mapRequest(getRequest(url));
View Full Code Here

   *
   */
  @Test(expected = StalePageException.class)
  public void decode9()
  {
    Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME +
      "/i1/i2?15-5.ILinkListener-foo-bar&a=b&b=c");

    context.setNextPageRenderCount(6);
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

View Full Code Here

   */
  @Test
  public void decode10()
  {
    // use String.class but any other non-Page will do the job as well
    Url url = Url.parse("wicket/bookmarkable/" + String.class.getName());

    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    assertNull("A non-page class should not create a request handler!", handler);
  }
View Full Code Here

   * {@link org.apache.wicket.core.request.mapper.IMapperContext#getNamespace()}/{@link org.apache.wicket.core.request.mapper.IMapperContext#getBookmarkableIdentifier()}
   */
  @Test
  public void decode11()
  {
    final Url url = Url.parse(context.getBookmarkableIdentifier() + "/" + PAGE_CLASS_NAME);

    Request request = new Request()
    {
      @Override
      public Url getUrl()
      {
        return url;
      }

      @Override
      public Locale getLocale()
      {
        return null;
      }

      @Override
      public Charset getCharset()
      {
        return Charset.forName("UTF-8");
      }

      @Override
      public Url getClientUrl()
      {
        StringBuilder url = new StringBuilder();
        url.append(context.getNamespace())
            .append('/')
            .append(context.getBookmarkableIdentifier())
            .append('/')
            .append("com.example.MyPage");
        return Url.parse(url.toString());
      }

      @Override
      public Object getContainerRequest()
      {
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.Url

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.