Package org.apache.wicket.protocol.http.servlet

Examples of org.apache.wicket.protocol.http.servlet.ServletWebRequest


      request.setServerPort(lastRequest.getServerPort());
    }

    response = new MockHttpServletResponse(request);

    ServletWebRequest servletWebRequest = newServletWebRequest();
    requestCycle = application.createRequestCycle(servletWebRequest,
      newServletWebResponse(servletWebRequest));
    requestCycle.setCleanupFeedbackMessagesOnDetach(false);
    ThreadContext.setRequestCycle(requestCycle);
View Full Code Here


  /**
   * @return servlet web request
   */
  private ServletWebRequest newServletWebRequest()
  {
    return new ServletWebRequest(request, request.getFilterPrefix());
  }
View Full Code Here

   * requests. Sometimes this method is useful when changes need to be checked without processing
   * a request.
   */
  public void applyRequest()
  {
    ServletWebRequest req = newServletWebRequest();
    requestCycle.setRequest(req);
    if (useRequestUrlAsBase)
    {
      requestCycle.getUrlRenderer().setBaseUrl(req.getUrl());
    }
  }
View Full Code Here

    Mockito.when(httpRequest.getServerName()).thenReturn(httpsUrl.getHost());
    Mockito.when(httpRequest.getRequestURI()).thenReturn(httpsUrl.getPath());
    Mockito.when(httpRequest.getQueryString()).thenReturn(httpsUrl.getQuery());

    final Url url = Url.parse(httpsUrl.getPath() + "?" + httpsUrl.getQuery());
    final ServletWebRequest webRequest = new ServletWebRequest(httpRequest, "", url);

    final IRequestCycle requestCycle = Mockito.mock(IRequestCycle.class);
    Mockito.when(requestCycle.getRequest()).thenReturn(webRequest);

    HttpsConfig httpsConfig = new HttpsConfig(80, 1443);
View Full Code Here

   *            the filter mapping read from web.xml
   * @return a WebRequest object
   */
  protected WebRequest newWebRequest(HttpServletRequest servletRequest, final String filterPath)
  {
    return new ServletWebRequest(servletRequest, filterPath);
  }
View Full Code Here

    }
    RequestParameters params = new RequestParameters();
    params.setBehaviorId(String.valueOf(index));
    if (request instanceof ServletWebRequest)
    {
      ServletWebRequest swr = (ServletWebRequest)request;
      // If we're coming in with an existing depth, use it. Otherwise,
      // compute from the URL. This provides correct behavior for repeated
      // AJAX requests: If we need to generate a URL within an AJAX
      // request for another one, it needs to be at the same depth as the
      // original AJAX request.
      int urlDepth = swr.getRequestParameters().getUrlDepth();
      params.setUrlDepth(urlDepth > -1 ? urlDepth : swr.getDepthRelativeToWicketHandler());
    }

    final IRequestTarget target = new BehaviorRequestTarget(component.getPage(), component,
      listener, params);
    return encodeUrlFor(target);
View Full Code Here

    throws IOException
  {

    // The ServletWebRequest is created here to avoid code duplication. The getURL
    // call doesn't depend on anything wicket specific
    ServletWebRequest req = new ServletWebRequest(request);
    String url = req.getURL();

    // Get the relative URL we need for loading the resource from
    // the servlet context
    // NOTE: we NEED to put the '/' in front as otherwise some versions
    // of application servers (e.g. Jetty 5.1.x) will fail for requests
View Full Code Here

    }
    RequestParameters params = new RequestParameters();
    params.setBehaviorId(String.valueOf(index));
    if (request instanceof ServletWebRequest)
    {
      ServletWebRequest swr = (ServletWebRequest)request;
      // If we're coming in with an existing depth, use it. Otherwise,
      // compute from the URL. This provides correct behavior for repeated
      // AJAX requests: If we need to generate a URL within an AJAX
      // request for another one, it needs to be at the same depth as the
      // original AJAX request.
      int urlDepth = swr.getRequestParameters().getUrlDepth();
      params.setUrlDepth(urlDepth > -1 ? urlDepth : swr.getDepthRelativeToWicketHandler());
    }

    final IRequestTarget target = new BehaviorRequestTarget(component.getPage(), component,
      listener, params);
    return encodeUrlFor(target);
View Full Code Here

   * @param servletRequest
   * @return a WebRequest object
   */
  protected WebRequest newWebRequest(final HttpServletRequest servletRequest)
  {
    return new ServletWebRequest(servletRequest);
  }
View Full Code Here

    }
    RequestParameters params = new RequestParameters();
    params.setBehaviorId(String.valueOf(index));
    if (request instanceof ServletWebRequest)
    {
      ServletWebRequest swr = (ServletWebRequest)request;
      // If we're coming in with an existing depth, use it. Otherwise,
      // compute from the URL. This provides correct behavior for repeated
      // AJAX requests: If we need to generate a URL within an AJAX
      // request for another one, it needs to be at the same depth as the
      // original AJAX request.
      int urlDepth = swr.getRequestParameters().getUrlDepth();
      params.setUrlDepth(urlDepth > -1 ? urlDepth : swr.getDepthRelativeToWicketHandler());
    }

    final IRequestTarget target = new BehaviorRequestTarget(component.getPage(), component,
        listener, params);
    final IRequestCodingStrategy requestCodingStrategy = getProcessor()
View Full Code Here

TOP

Related Classes of org.apache.wicket.protocol.http.servlet.ServletWebRequest

Copyright © 2018 www.massapicom. 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.