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

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


  {
    request = new MockHttpServletRequest(application, httpSession, servletContext);
    request.setURL(request.getContextPath() + request.getServletPath() + "/");
    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

    {
      // Change the request to a multipart web request so parameters are
      // parsed out correctly
      try
      {
        ServletWebRequest request = (ServletWebRequest)getRequest();
        final WebRequest multipartWebRequest = request.newMultipartWebRequest(getMaxSize());
        // TODO: Can't this be detected from header?
        getRequestCycle().setRequest(multipartWebRequest);
      }
      catch (final FileUploadException fux)
      {
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

      {
        servletRequest = factory.getWrapper(servletRequest);
      }
    }

    return new ServletWebRequest(servletRequest, filterPath);
  }
View Full Code Here

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

    transferCookies();

    response = new MockHttpServletResponse(request);

    ServletWebRequest servletWebRequest = newServletWebRequest();
    requestCycle = application.createRequestCycle(servletWebRequest,
      newServletWebResponse(servletWebRequest));
    ThreadContext.setRequestCycle(requestCycle);

    if (session == null)
View Full Code Here

      {
        return locale;
      }
    };

    WebSession session = new WebSession(new ServletWebRequest(request));
    assertEquals(locale, session.getLocale());
  }
View Full Code Here

  private void assertWithHeader(String header, String value, boolean isAjax)
  {
    MockHttpServletRequest mockRequest = tester.getServletRequest();
    mockRequest.addHeader(header, value);

    WebRequest webRequest = new ServletWebRequest(mockRequest);

    assertEquals(isAjax, webRequest.isAjax());
  }
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.