Examples of urlFor()


Examples of org.apache.wicket.Page.urlFor()

  {
    // Get the page we want a url from:
    Page page = requestTarget.getPage();

    // A url to a page is the IRedirectListener interface:
    CharSequence urlRedirect = page.urlFor(IRedirectListener.INTERFACE);

    // Touch the page once because it could be that it did go from stateless
    // to statefull or it was a internally made page where just a url must
    // be made for (frames)
    Session.get().touch(page);
View Full Code Here

Examples of org.apache.wicket.Page.urlFor()

  {
    // Get the page we want a url from:
    Page page = requestTarget.getPage();

    // A url to a page is the IRedirectListener interface:
    CharSequence urlRedirect = page.urlFor(IRedirectListener.INTERFACE);

    // Touch the page once because it could be that it did go from stateless
    // to stateful or it was a internally made page where just a url must
    // be made for (frames)
    Session.get().touch(page);
View Full Code Here

Examples of org.apache.wicket.RequestCycle.urlFor()

    this(pageClass, null);
  }

  public <C extends Page> GitblitRedirectException(Class<C> pageClass, PageParameters params) {
    RequestCycle cycle = RequestCycle.get();
    String relativeUrl = cycle.urlFor(pageClass, params).toString();
    String absoluteUrl = RequestUtils.toAbsolutePath(relativeUrl);
    cycle.setRequestTarget(new RedirectRequestTarget(absoluteUrl));
    cycle.setRedirect(true);
  }
}
View Full Code Here

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

   *
   */
  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

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

  {
    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

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

    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

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

        {
          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

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

        {
          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

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

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
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.