Package org.apache.wicket.protocol.http

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


    Session.get().setLocale(Locale.GERMANY);
    CharSequence url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test_de_DE", url);

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

    Session.get().setStyle("bar");
    Session.get().setLocale(Locale.US);
    url = cycle.urlFor(rr);
View Full Code Here


    url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test_foo_de_DE", url);

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

  /**
   * @throws Exception
View Full Code Here

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

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

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

    Session.get().setLocale(Locale.GERMANY);
    CharSequence url = cycle.urlFor(rr);
    assertEquals("resources/org.apache.wicket.Application/test", url);

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

    Session.get().setStyle("bar");
    Session.get().setLocale(Locale.US);
    url = cycle.urlFor(rr);
View Full Code Here

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

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

    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

    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

    // available, so we need to fake one here(testing only hack), fixed in
    // wicket 1.3.4
    mock.setupRequestAndResponse();
    WebRequestCycle cycle = mock.createRequestCycle();
    String url1 =
      cycle.urlFor(new BookmarkablePageRequestTarget(ContainerPage2.class, null)).toString();
    mock.getServletRequest().setURL("/ContainerTest$1/ContainerTest$1/" + url1);
    mock.processRequestCycle();
    mock.assertRenderedPage(MockLoginPage.class);
    FormTester form = mock.newFormTester("form");
    form.setValue("username", "container4");
View Full Code Here

    // available, so we need to fake one here(testing only hack), fixed in
    // wicket 1.3.4
    mock.setupRequestAndResponse();
    WebRequestCycle cycle = mock.createRequestCycle();
    String url1 =
      cycle.urlFor(new BookmarkablePageRequestTarget(ContainerPage2.class, null)).toString();
    mock.getServletRequest().setURL("/ContainerTest$1/ContainerTest$1/" + url1);
    mock.processRequestCycle();
    mock.assertRenderedPage(MockLoginPage.class);
    FormTester form = mock.newFormTester("form");
    form.setValue("username", username);
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.