Package org.apache.wicket.protocol.http

Examples of org.apache.wicket.protocol.http.WebResponse


    else
    {
      url = requestCycle.urlFor(target).toString();
    }

    WebResponse response = (WebResponse)requestCycle.getResponse();

    // an attempt to rewrite a secure jsessionid into nonsecure, doesnt seem to work
    // Session session = Session.get();
    // if (!session.isTemporary())
    // {
    // response.addCookie(new Cookie("JSESSIONID", session.getId()));
    // }

    response.redirect(url);
  }
View Full Code Here


  /**
   * @see org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle)
   */
  public final void respond(final RequestCycle requestCycle)
  {
    final WebResponse response = (WebResponse)requestCycle.getResponse();

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

    for (ITargetRespondListener listener : respondListeners)
    {
      listener.onTargetRespond(this);
    }

    final Application app = Application.get();

    // Determine encoding
    final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding();

    // Set content type based on markup type for page
    response.setCharacterEncoding(encoding);
    response.setContentType("text/xml; charset=" + encoding);

    // Make sure it is not cached by a client
    response.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
    response.setHeader("Cache-Control", "no-cache, must-revalidate");
    response.setHeader("Pragma", "no-cache");

    response.write("<?xml version=\"1.0\" encoding=\"");
    response.write(encoding);
    response.write("\"?>");
    response.write("<ajax-response>");

    // invoke onbeforerespond event on listeners
    fireOnBeforeRespondListeners();

    // normal behavior
    Iterator<String> it = prependJavascripts.iterator();
    while (it.hasNext())
    {
      String js = it.next();
      respondInvocation(response, js);
    }

    // process added components
    respondComponents(response);

    fireOnAfterRespondListeners(response);

    // execute the dom ready javascripts as first javascripts
    // after component replacement
    it = domReadyJavascripts.iterator();
    while (it.hasNext())
    {
      String js = it.next();
      respondInvocation(response, js);
    }
    it = appendJavascripts.iterator();
    while (it.hasNext())
    {
      String js = it.next();
      respondInvocation(response, js);
    }

    response.write("</ajax-response>");
  }
View Full Code Here

      {
        throw new IllegalStateException(
          "This exception can only be thrown when wicket is processing an http request");
      }

      WebResponse wr = (WebResponse)r;
      wr.getHttpServletResponse().setStatus(status);

      // abort any further response processing
      rc.setRequestTarget(EmptyRequestTarget.getInstance());
    }
  }
View Full Code Here

      }

      @Override
      protected WebResponse newWebResponse(final HttpServletResponse servletResponse)
      {
        return new WebResponse(servletResponse);
      }

      @Override
      protected void outputDevelopmentModeWarning()
      {
View Full Code Here

     * @see org.apache.wicket.protocol.http.WebApplication#newWebResponse(javax.servlet.http.HttpServletResponse)
     */
    @Override
    protected WebResponse newWebResponse(final HttpServletResponse servletResponse)
    {
      return new WebResponse(servletResponse);
    }
View Full Code Here

  {
    super.configureResponse();

    if (getWebRequestCycle().getResponse() instanceof WebResponse)
    {
      final WebResponse response = getWebRequestCycle().getWebResponse();
      setHeaders(response);
    }
  }
View Full Code Here

    return null;
  }

  protected WebResponse newWebResponse(final HttpServletResponse servletResponse)
  {
    return new WebResponse(servletResponse);
  }
View Full Code Here

    // Determine encoding
    final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding();

    // Set content type based on markup type for page
    final WebResponse response = (WebResponse)requestCycle.getResponse();
    response.setCharacterEncoding(encoding);
    response.setContentType("text/xml; charset=" + encoding);

    // Make sure it is not cached by a client
    response.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
    response.setHeader("Cache-Control", "no-cache, must-revalidate");
    response.setHeader("Pragma", "no-cache");

    response.write("<?xml version=\"1.0\" encoding=\"");
    response.write(encoding);
    response.write("\"?>");
    response.write("<ajax-response>");

    // invoke onbeforerespond event on listeners
    fireOnBeforeRespondListeners();

    // normal behavior
    Iterator it = prependJavascripts.iterator();
    while (it.hasNext())
    {
      String js = (String)it.next();
      respondInvocation(response, js);
    }

    // process added components
    respondComponents(response);

    fireOnAfterRespondListeners(response);

    // execute the dom ready javascripts as first javascripts
    // after component replacement
    it = domReadyJavascripts.iterator();
    while (it.hasNext())
    {
      String js = (String)it.next();
      respondInvocation(response, js);
    }
    it = appendJavascripts.iterator();
    while (it.hasNext())
    {
      String js = (String)it.next();
      respondInvocation(response, js);
    }

    response.write("</ajax-response>");
  }
View Full Code Here

      return new MySession(this, request);
    }

    protected WebResponse newWebResponse(HttpServletResponse servletResponse)
    {
      return new WebResponse(servletResponse);
    }
View Full Code Here

        return new HttpSessionStore(this);
      }

      protected WebResponse newWebResponse(final HttpServletResponse servletResponse)
      {
        return new WebResponse(servletResponse);
      }

      protected void outputDevelopmentModeWarning()
      {
        // Do nothing.
View Full Code Here

TOP

Related Classes of org.apache.wicket.protocol.http.WebResponse

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.