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

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


  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


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

  private void fallback(HttpServletRequest request, HttpServletResponse response)
    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();

    // WICKET-2185: strip of query string
    if (url.indexOf('?') != -1)
    {
      url = Strings.beforeFirst(url, '?');
View Full Code Here

  @Override
  public void onResourceRequested()
  {
    RequestCycle requestCycle = RequestCycle.get();
    ServletWebRequest request = (ServletWebRequest)requestCycle.getRequest();

    // Grab a Meteor
    Meteor meteor = Meteor.build(request.getContainerRequest());
    String uuid = getUUID(meteor.getAtmosphereResource());
    component.getPage().setMetaData(ATMOSPHERE_UUID, uuid);
    findEventBus().registerPage(uuid, component.getPage());

    // Add us to the listener list.
    meteor.addListener(this);

    String transport = request.getHeader(HeaderConfig.X_ATMOSPHERE_TRANSPORT);
    if (HeaderConfig.LONG_POLLING_TRANSPORT.equalsIgnoreCase(transport))
    {
      // request.getContainerRequest().setAttribute(ApplicationConfig.RESUME_ON_BROADCAST,
      // Boolean.TRUE);
      meteor.suspend(-1, false);
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(),
          getPage().getId());
        // TODO: Can't this be detected from header?
        getRequestCycle().setRequest(multipartWebRequest);
      }
      catch (final FileUploadException fux)
View Full Code Here

   * @param servletRequest
   * @return a WebRequest object
   */
  protected WebRequest newWebRequest(final HttpServletRequest servletRequest)
  {
    return new ServletWebRequest(servletRequest);
  }
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

  private void fallback(HttpServletRequest request, HttpServletResponse response)
    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();

    // WICKET-2185: strip of query string
    if (url.indexOf('?') != -1)
    {
      url = Strings.beforeFirst(url, '?');
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

    }
    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

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.