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

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


  @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);
    EventBus.get().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


    transferCookies();

    response = new MockHttpServletResponse(request);

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

    if (session == null)
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

    @Override
    protected ResourceResponse newResourceResponse(Attributes attributes)
    {
        final ResourceResponse resourceResponse = new ResourceResponse();

        final ServletWebRequest webRequest = (ServletWebRequest) attributes.getRequest();

        try
        {
            MultipartServletWebRequest multiPartRequest = webRequest.newMultipartWebRequest(getMaxSize(), "ignored");

            Map<String, List<FileItem>> files = multiPartRequest.getFiles();
            List<FileItem> fileItems = files.get(FileUploadBehavior.PARAM_NAME);

            saveFiles(fileItems);
View Full Code Here

        private static final String FILENAME = "filename";

        @Override
        protected ResourceResponse newResourceResponse(Attributes attributes) {
            ServletWebRequest request = (ServletWebRequest) attributes.getRequest();
            IRequestParameters queryParameters = request.getQueryParameters();
            boolean delete = queryParameters.getParameterValue("delete").toBoolean(false);
            final StringValue fileName = queryParameters.getParameterValue(FILENAME);

            final ResourceResponse resourceResponse = new ResourceResponse();
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

        cookies.addAll(lastResponseCookies);
        request.addCookies(cookies.asList());
      }
    }

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

    if (session == null)
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

    if (domain != null)
    {
      cookie.setDomain(domain);
    }

    ServletWebRequest request = (ServletWebRequest)getWebRequest();
    String path = request.getContainerRequest().getContextPath() + "/" +
      request.getFilterPrefix();

    cookie.setPath(path);
    cookie.setVersion(settings.getVersion());
    cookie.setSecure(settings.getSecure());
    cookie.setMaxAge(settings.getMaxAge());
View Full Code Here

   * @return remoteAddr IP address of the client, using the X-Forwarded-For header and defaulting
   *         to: getHttpServletRequest().getRemoteAddr()
   */
  protected String getRemoteAddr(RequestCycle requestCycle)
  {
    ServletWebRequest request = (ServletWebRequest)requestCycle.getRequest();
    HttpServletRequest req = request.getContainerRequest();
    String remoteAddr = request.getHeader("X-Forwarded-For");

    if (remoteAddr != null)
    {
      if (remoteAddr.contains(","))
      {
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.