Package org.apache.wicket.request

Examples of org.apache.wicket.request.Response$StreamAdapter


   * {@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

   * @param attributes
   *            request attributes
   */
  protected void configureCache(final ResourceResponse data, final Attributes attributes)
  {
    Response response = attributes.getResponse();

    if (response instanceof WebResponse)
    {
      Duration duration = data.getCacheDuration();
      WebResponse webResponse = (WebResponse)response;
View Full Code Here

   * @param data
   * @param attributes
   */
  protected void setResponseHeaders(final ResourceResponse data, final Attributes attributes)
  {
    Response response = attributes.getResponse();
    if (response instanceof WebResponse)
    {
      WebResponse webResponse = (WebResponse)response;

      // 1. Last Modified
View Full Code Here

     * @param stream
     *            input stream
     */
    protected final void writeStream(Attributes attributes, InputStream stream)
    {
      final Response response = attributes.getResponse();
      OutputStream s = new OutputStream()
      {
        @Override
        public void write(int b) throws IOException
        {
          response.write(new byte[] { (byte)b });
        }

        @Override
        public void write(byte[] b) throws IOException
        {
          response.write(b);
        }

        @Override
        public void write(byte[] b, int off, int len) throws IOException
        {
          response.write(b, off, len);
        }
      };
      try
      {
        Streams.copy(stream, s);
View Full Code Here

  protected BufferedWebResponse renderPage(Url targetUrl, RequestCycle requestCycle)
  {
    IRequestHandler scheduled = requestCycle.getRequestHandlerScheduledAfterCurrent();

    // keep the original response
    final Response originalResponse = requestCycle.getResponse();

    // buffered web response for page
    BufferedWebResponse response = new BufferedWebResponse((WebResponse)originalResponse);

    // keep the original base URL
View Full Code Here

   */
  public AbstractAjaxResponse(final Page page)
  {
    this.page = page;

    Response response = page.getResponse();
    encodingBodyResponse = new AjaxResponse(response);
    encodingHeaderResponse = new AjaxResponse(response);
  }
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();

      // render the head of component and all it's children
View Full Code Here

      // 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

TOP

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

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.