Package org.apache.wicket.protocol.http

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


    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:b", url1);
    assertEquals("test2/Integer0/Integer1/a:b/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.toString());

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

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

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

  /**
   * @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.toString());

    rr = new ResourceReference(SharedResourceUrlTest.class, "test");
    url = cycle.urlFor(rr, new ValueMap("param=value", ""));
    assertEquals("resources/org.apache.wicket.SharedResourceUrlTest/test?param=value",
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.toString());

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

  public void testResourceReferenceUrl_SessionLocale() throws Exception
View Full Code Here

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

    Session.get().setLocale(Locale.GERMANY);
    ResourceReference rr = new ResourceReference(Application.class, "test.css", true, false);
    CharSequence url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test_de_DE.css", url.toString());

    Session.get().setLocale(Locale.US);
    url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test_en_US.css", url.toString());
View Full Code Here

    ResourceReference rr = new ResourceReference(Application.class, "test.css", true, false);
    CharSequence url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test_de_DE.css", url.toString());

    Session.get().setLocale(Locale.US);
    url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test_en_US.css", url.toString());
  }

  /**
   * @throws Exception
View Full Code Here

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

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

    Session.get().setStyle("foo");
    url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test_foo", url.toString());
View Full Code Here

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

    Session.get().setStyle("foo");
    url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test_foo", url.toString());

    Session.get().setStyle("bar");
    url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test_bar", url.toString());
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.