Examples of StringBufferResourceStream


Examples of org.apache.wicket.util.resource.StringBufferResourceStream

  public void respond(RequestCycle requestCycle)
  {
    // Get servlet response to use when responding with resource
    final Response response = requestCycle.getResponse();
    response.setContentType(contentType);
    final StringBufferResourceStream stream = new StringBufferResourceStream(contentType);
    stream.append(string);

    // Respond with resource
    try
    {
      final OutputStream out = response.getOutputStream();
      try
      {
        Streams.copy(stream.getInputStream(), out);
      }
      finally
      {
        stream.close();
        out.flush();
      }
    }
    catch (Exception e)
    {
View Full Code Here

Examples of org.apache.wicket.util.resource.StringBufferResourceStream

   */
  public void respond(RequestCycle requestCycle)
  {
    // Get servlet response to use when responding with resource
    final Response response = requestCycle.getResponse();
    final StringBufferResourceStream stream = new StringBufferResourceStream(contentType);
    stream.append(string);

    // Respond with resource
    try
    {
      final OutputStream out = response.getOutputStream();
      try
      {
        Streams.copy(stream.getInputStream(), out);
      }
      finally
      {
        stream.close();
        out.flush();
      }
    }
    catch (Exception e)
    {
View Full Code Here

Examples of org.apache.wicket.util.resource.StringBufferResourceStream

   */
  public void respond(RequestCycle requestCycle)
  {
    // Get servlet response to use when responding with resource
    final Response response = requestCycle.getResponse();
    final StringBufferResourceStream stream = new StringBufferResourceStream();
    stream.append(string);

    // Respond with resource
    try
    {
      final OutputStream out = response.getOutputStream();
      try
      {
        Streams.copy(stream.getInputStream(), out);
      }
      finally
      {
        stream.close();
        out.flush();
      }
    }
    catch (Exception e)
    {
View Full Code Here

Examples of org.apache.wicket.util.resource.StringBufferResourceStream

   */
  public void respond(RequestCycle requestCycle)
  {
    // Get servlet response to use when responding with resource
    final Response response = requestCycle.getResponse();
    final StringBufferResourceStream stream = new StringBufferResourceStream();
    stream.append(string);

    // Respond with resource
    try
    {
      final OutputStream out = response.getOutputStream();
      try
      {
        Streams.copy(stream.getInputStream(), out);
      }
      finally
      {
        stream.close();
        out.flush();
      }
    }
    catch (Exception e)
    {
View Full Code Here

Examples of org.apache.wicket.util.resource.StringBufferResourceStream

      catch (IOException e)
      {
        throw new RuntimeException(e);
      }
    }
    resourceStream = new StringBufferResourceStream(contentType);
  }
View Full Code Here

Examples of org.apache.wicket.util.resource.StringBufferResourceStream

        reader.close();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    resourceStream = new StringBufferResourceStream(contentType);
  }
View Full Code Here

Examples of org.apache.wicket.util.resource.StringBufferResourceStream

  }

  private void testGeneratedMarkup(final String expected)
  {
    final APanel aPanel = (APanel)tester.getComponentFromLastRenderedPage("aPanel");
    final StringBufferResourceStream resourceStream = (StringBufferResourceStream)aPanel.getMarkupResourceStream(
      aPanel, APanel.class);

    Assert.assertEquals(expected, resourceStream.asString());
  }
View Full Code Here

Examples of org.apache.wicket.util.resource.StringBufferResourceStream

      }
    });
    tester.startPage(pageSource);

    final APanel aPanel = (APanel)tester.getComponentFromLastRenderedPage("aPanel");
    final StringBufferResourceStream resourceStream = (StringBufferResourceStream)aPanel.getMarkupResourceStream(
      aPanel, APanel.class);
    System.out.println(resourceStream.asString());
  }
View Full Code Here

Examples of org.apache.wicket.util.resource.StringBufferResourceStream

  {
    if (container != this)
      throw new IllegalArgumentException("Container " + container + " must be instance " +
        this);

    final StringBufferResourceStream resourceStream = new StringBufferResourceStream();
    resourceStream.append(thisPanelRenderer.getMarkup((APanel)container));
    return resourceStream;
  }
View Full Code Here

Examples of org.apache.wicket.util.resource.StringBufferResourceStream

      }

      public IResourceStream getMarkupResourceStream(final MarkupContainer container,
        final Class containerClass)
      {
        return new StringBufferResourceStream().append("<wicket:panel></wicket:panel>");
      }
    }
    page.getAPanel().add(new TestPanel("panel"));
    tester.startPage(new TestPageSource(page));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.