Package org.apache.wicket.request.cycle

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


      CharSequence pageUrl;
      RequestCycle requestCycle = RequestCycle.get();

      if (page.isPageStateless())
      {
        pageUrl = requestCycle.urlFor(page.getClass(), page.getPageParameters());
      }
      else
      {
        IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
        pageUrl = requestCycle.urlFor(handler);
View Full Code Here


        pageUrl = requestCycle.urlFor(page.getClass(), page.getPageParameters());
      }
      else
      {
        IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
        pageUrl = requestCycle.urlFor(handler);
      }

      appendAssignment(buffer, "settings.src", pageUrl);
    }
    else
View Full Code Here

    if (markupIdToComponent.values().contains(page))
    {
      // the page itself has been added to the request target, we simply issue a redirect
      // back to the page
      IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
      final String url = rc.urlFor(handler).toString();
      response.sendRedirect(url);
      return;
    }

    respondersFrozen = true;
View Full Code Here

        return null;
      }
    };

    RequestCycle requestCycle = mock(RequestCycle.class);
    when(requestCycle.urlFor(any(IRequestHandler.class))).thenReturn(RESOURCE_NAME);

    Request request = mock(Request.class);
    when(request.getCharset()).thenReturn(Charset.defaultCharset());
    when(requestCycle.getRequest()).thenReturn(request);
View Full Code Here

      if (markupIdToComponent.values().contains(page))
      {
        // the page itself has been added to the request target, we simply issue a redirect
        // back to the page
        IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
        final String url = rc.urlFor(handler).toString();
        response.sendRedirect(url);
        return;
      }

      for (ITargetRespondListener listener : respondListeners)
View Full Code Here

          // doing that now and redirect
          setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE);
          Request request = requestCycle.getRequest();

          IRequestHandler activeRequestHandler = requestCycle.getActiveRequestHandler();
          String url = requestCycle.urlFor(activeRequestHandler).toString();
          String relativeUrl = requestCycle.getUrlRenderer()
            .renderContextPathRelativeUrl(url);
          Page browserInfoPage = newBrowserInfoPage(relativeUrl);
          throw new RestartResponseException(browserInfoPage);
        }
View Full Code Here

        return null;
      }
    };

    RequestCycle requestCycle = mock(RequestCycle.class);
    when(requestCycle.urlFor(any(IRequestHandler.class))).thenReturn(RESOURCE_NAME);

    Request request = mock(Request.class);
    when(request.getCharset()).thenReturn(Charset.defaultCharset());
    when(requestCycle.getRequest()).thenReturn(request);
View Full Code Here

   */
  public static String getAbsoluteContextPath()
  {
    if (absoluteContextPath == null) {
      final RequestCycle requestCycle = RequestCycle.get();
      final String url = requestCycle.getUrlRenderer().renderFullUrl(Url.parse(requestCycle.urlFor(LoginPage.class, null).toString()));
      final String basePath = "/" + WICKET_APPLICATION_PATH;
      final int pos = url.indexOf(basePath);
      if (pos < 0) {
        log.warn("Couln't get base url of '" + url + "'. Sub string '" + basePath + "' expected.");
        return url;
View Full Code Here

  public static String getBookmarkablePageUrl(final Class< ? extends Page> pageClass, final String... params)
  {
    final RequestCycle requestCylce = RequestCycle.get();
    if (requestCylce != null) {
      final PageParameters pageParameter = getPageParameters(params);
      return requestCylce.urlFor(pageClass, pageParameter).toString();
    } else {
      // RequestCycle.get().urlFor(pageClass, pageParameter).toString() can't be used for non wicket requests!
      final String alias = WicketApplication.getBookmarkableMountPath(pageClass);
      if (alias == null) {
        log.error("Given page class is not mounted. Please mount class in WicketApplication: " + pageClass);
View Full Code Here

      CharSequence pageUrl = null;
      RequestCycle requestCycle = RequestCycle.get();

      if (page.isPageStateless())
      {
        pageUrl = requestCycle.urlFor(page.getClass(), page.getPageParameters());
        appendAssignment(buffer, "settings.ie8_src", pageUrl);
      }
      else
      {
        IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
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.