Package org.apache.wicket.protocol.http

Examples of org.apache.wicket.protocol.http.WebRequestCycle.urlFor()


    PageParameters parameters = new PageParameters();
    parameters.add("0", "Integer0");
    parameters.add("1", "Integer1");
    parameters.add("2", "a:b");

    String url1 = cycle.urlFor(
        new BookmarkablePageRequestTarget(BookmarkableHomePageLinksPage.class, parameters))
        .toString();
    String url2 = cycle.urlFor(
        new BookmarkablePageRequestTarget("mypagemap", BookmarkableHomePageLinksPage.class,
            parameters)).toString();
View Full Code Here


    parameters.add("2", "a:b");

    String url1 = cycle.urlFor(
        new BookmarkablePageRequestTarget(BookmarkableHomePageLinksPage.class, parameters))
        .toString();
    String url2 = cycle.urlFor(
        new BookmarkablePageRequestTarget("mypagemap", BookmarkableHomePageLinksPage.class,
            parameters)).toString();
    assertEquals("test1/Integer0/Integer1/a%3Ab", url1);
    assertEquals("test2/Integer0/Integer1/a%3Ab/wicket:pageMapName/mypagemap", url2);
View Full Code Here

        {
          IBookmarkablePageRequestTarget current = (IBookmarkablePageRequestTarget)target;
          BookmarkablePageRequestTarget redirect = new BookmarkablePageRequestTarget(
            session.createAutoPageMapName(), current.getPageClass(),
            current.getPageParameters());
          url = cycle.urlFor(redirect);
        }
        else
        {
          url = webPage.urlFor(INewBrowserWindowListener.INTERFACE);
        }
View Full Code Here

  {
    tester.setupRequestAndResponse();
    WebRequestCycle cycle = tester.createRequestCycle();

    ResourceReference rr = new ResourceReference("test");
    CharSequence url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test", url);

    rr = new ResourceReference(SharedResourceUrlTest.class, "test");
    url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.SharedResourceUrlTest/test", url);
View Full Code Here

    ResourceReference rr = new ResourceReference("test");
    CharSequence url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test", url);

    rr = new ResourceReference(SharedResourceUrlTest.class, "test");
    url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.SharedResourceUrlTest/test", url);
  }

  /**
   * @throws Exception
View Full Code Here

  {
    tester.setupRequestAndResponse();
    WebRequestCycle cycle = tester.createRequestCycle();

    ResourceReference rr = new ResourceReference("test");
    CharSequence url = cycle.urlFor(rr, new ValueMap("param=value", ""));
    assertEquals("resources/org.apache.wicket.Application/test?param=value", url);

    rr = new ResourceReference(SharedResourceUrlTest.class, "test");
    url = cycle.urlFor(rr, new ValueMap("param=value", ""));
    assertEquals("resources/org.apache.wicket.SharedResourceUrlTest/test?param=value", url);
View Full Code Here

    ResourceReference rr = new ResourceReference("test");
    CharSequence url = cycle.urlFor(rr, new ValueMap("param=value", ""));
    assertEquals("resources/org.apache.wicket.Application/test?param=value", url);

    rr = new ResourceReference(SharedResourceUrlTest.class, "test");
    url = cycle.urlFor(rr, new ValueMap("param=value", ""));
    assertEquals("resources/org.apache.wicket.SharedResourceUrlTest/test?param=value", url);
  }

}
View Full Code Here

   *
   */
  public void testEmptyRequest()
  {
    final WebRequestCycle cycle = tester.setupRequestAndResponse();
    final String url = cycle.urlFor(new ResourceReference(RESOURCE_NAME)).toString();
    assertEquals("test", url);
    tester.getServletRequest().setURL(URL_PREFIX + url);
    tester.processRequestCycle(cycle);
    assertTrue(resource.params.isEmpty());
  }
View Full Code Here

  {
    final WebRequestCycle cycle = tester.setupRequestAndResponse();
    final ValueMap params = new ValueMap();
    params.add("0", "foo");
    params.add("1", "bar");
    final String url = cycle.urlFor(new ResourceReference(RESOURCE_NAME), params).toString();
    assertEquals("test/foo/bar", url);
    tester.getServletRequest().setURL(URL_PREFIX + url);
    tester.processRequestCycle(cycle);
    assertEquals(2, resource.params.size());
    assertEquals("foo", resource.params.getString("0"));
View Full Code Here

    params.add("0", "param0");
    params.add("1", "param1");
    params.put("test", new String[] { "testval1", "testval2" });
    params.add("foo", "fooval");
    final String url = cycle.urlFor(new ResourceReference(RESOURCE_NAME), params).toString();
    assertEquals("test/param0/param1?test=testval1&test=testval2&foo=fooval", url);
    tester.getServletRequest().setURL(URL_PREFIX + url);
    tester.processRequestCycle(cycle);
    assertEquals(4, resource.params.size());
    assertEquals("fooval", resource.params.getString("foo"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.