Package org.apache.wicket.request

Examples of org.apache.wicket.request.Response


      // was created but any of the components or behaviors want to contribute
      // something to the header.
      header = new HtmlHeaderContainer(HtmlHeaderSectionHandler.HEADER_ID);
      add(header);

      Response orgResponse = getRequestCycle().getResponse();
      try
      {
        final StringResponse response = new StringResponse();
        getRequestCycle().setResponse(response);
View Full Code Here


  @Override
  public IRequestHandler map(Exception e)
  {
    try
    {
      Response response = RequestCycle.get().getResponse();
      if (response instanceof WebResponse)
      {
        // we don't want to cache an exceptional reply in the browser
        ((WebResponse)response).disableCaching();
      }
View Full Code Here

   */
  public static CharSequence renderComponent(final Component component)
  {
    RequestCycle requestCycle = RequestCycle.get();

    final Response originalResponse = requestCycle.getResponse();
    BufferedWebResponse tempResponse = new BufferedWebResponse(null);

    MarkupContainer oldParent = component.getParent();

    try
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Response setResponse(final Response response)
  {
    Response current = activeResponse;
    activeResponse = response;
    return current;
  }
View Full Code Here

  {

    @Override
    protected void respond(IRequestHandler handler)
    {
      Response originalResponse = getResponse();
      try
      {
        handler.respond(RequestCycle.this);
      }
      finally
View Full Code Here

      // single url), and then "flush" (by writing to the real response) before closing.
      // to support this, we need to allow header contributions to be written in the close
      // tag, which we do here:
      headerRendering = true;
      // save old response, set new
      Response oldResponse = RequestCycle.get().setResponse(encodingHeaderResponse);
      encodingHeaderResponse.reset();

      // now, close the response (which may render things)
      header.getHeaderResponse().close();
View Full Code Here

    }

    RequestCycle requestCycle = component.getRequestCycle();

    // save old response, set new
    Response oldResponse = requestCycle.setResponse(encodingHeaderResponse);

    try {
      encodingHeaderResponse.reset();

      IHeaderRenderStrategy strategy = AbstractHeaderRenderStrategy.get();
View Full Code Here

     * Prepare
     */
    @Before
    public void before()
    {
        final Response realResponse = new StringResponse();

        headerResponse = new HeaderResponse()
        {
            @Override
            protected Response getRealResponse()
View Full Code Here

   * @param code
   */
  private void execute(final Runnable code)
  {
    // Temporarily replace the web response with a String response
    final Response webResponse = getResponse();

    try
    {
      // Create a new response object
      final Response response = newResponse();
      if (response == null)
      {
        throw new IllegalStateException("newResponse() must not return null");
      }

      // and make it the current one
      getRequestCycle().setResponse(response);

      // Invoke default execution
      code.run();

      try
      {
        // Tranform the data
        CharSequence output = transform(this, response.toString());
        webResponse.write(output);
      }
      catch (Exception ex)
      {
        throw new WicketRuntimeException("Error while transforming the output: " + this, ex);
View Full Code Here

      // Allow component to contribute
      if (response.wasRendered(this) == false)
      {
        StringResponse markupHeaderResponse = new StringResponse();
        Response oldResponse = getResponse();
        RequestCycle.get().setResponse(markupHeaderResponse);
        try
        {
          // Make sure the markup source strategy contributes to the header first
          // to be backward compatible. WICKET-3761
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.Response

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.