Package org.apache.tapestry.util

Examples of org.apache.tapestry.util.ContentType


    {
        _localeManager.persistLocale();

        IPage page = cycle.getPage();

        ContentType contentType = page.getResponseContentType();

        String encoding = contentType.getParameter(ENCODING_KEY);

        if (encoding == null)
        {
            encoding = cycle.getEngine().getOutputEncoding();

            contentType.setParameter(ENCODING_KEY, encoding);
        }

        PrintWriter printWriter = _webResponse.getPrintWriter(contentType);

        IMarkupWriter writer = _markupWriterSource.newMarkupWriter(printWriter, contentType);
View Full Code Here


    {
        CharArrayWriter caw = new CharArrayWriter();
        PrintWriter pw = new PrintWriter(caw);

        IMarkupWriter writer = _markupWriterSource.newMarkupWriter(pw,
                new ContentType("text/html"));

        writeException(writer, cycle, cause);

        writer.close();
View Full Code Here

    private void reportRenderRequestException(IRequestCycle cycle,
            Throwable cause)
        throws IOException
    {
        PrintWriter pw = _response.getPrintWriter(new ContentType("text/html"));

        IMarkupWriter writer = _markupWriterSource.newMarkupWriter(pw,
                new ContentType("text/html"));

        writeException(writer, cycle, cause);
    }
View Full Code Here

    {
        CharArrayWriter caw = new CharArrayWriter();
        PrintWriter pw = new PrintWriter(caw);

        IMarkupWriter writer = _markupWriterSource
                .newMarkupWriter(pw, new ContentType("text/html"));

        writeException(writer, cycle, cause);

        writer.close();
View Full Code Here

    }

    private void reportRenderRequestException(IRequestCycle cycle, Throwable cause)
            throws IOException
    {
        PrintWriter pw = _response.getPrintWriter(new ContentType("text/html"));

        IMarkupWriter writer = _markupWriterSource
                .newMarkupWriter(pw, new ContentType("text/html"));

        writeException(writer, cycle, cause);
    }
View Full Code Here

        replayControls();

        ServletWebResponse swr = new ServletWebResponse(response);

        assertSame(stream, swr.getOutputStream(new ContentType("foo/bar")));

        verifyControls();
    }
View Full Code Here

        ServletWebResponse swr = new ServletWebResponse(response);

        try
        {
            swr.getOutputStream(new ContentType("foo/bar"));
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals(
View Full Code Here

        replayControls();

        ServletWebResponse swr = new ServletWebResponse(response);

        assertSame(writer, swr.getPrintWriter(new ContentType("foo/bar")));

        verifyControls();
    }
View Full Code Here

        replayControls();

        ServletWebResponse swr = new ServletWebResponse(response);

        assertSame(writer1, swr.getPrintWriter(new ContentType("foo/bar")));

        verifyControls();

        response.reset();
        response.setContentType("zip/zap");
        response.getWriter();
        control.setReturnValue(writer2);

        replayControls();

        assertSame(writer2, swr.getPrintWriter(new ContentType("zip/zap")));

        verifyControls();
    }
View Full Code Here

        ServletWebResponse swr = new ServletWebResponse(response);

        try
        {
            swr.getPrintWriter(new ContentType("foo/bar"));
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals(
View Full Code Here

TOP

Related Classes of org.apache.tapestry.util.ContentType

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.