Package org.apache.tapestry.util

Examples of org.apache.tapestry.util.ContentType


        ServletWebResponse swr = new ServletWebResponse(response);

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


        {
            IChartProvider provider = (IChartProvider) component;

            Chart chart = provider.getChart();

            OutputStream output = _response.getOutputStream(new ContentType("image/jpeg"));

            // I've seen a few bits of wierdness (including a JVM crash) inside this code.
            // Hopefully, its a multi-threading problem that can be resolved
            // by synchronizing.
View Full Code Here

        return cycle;
    }

    public void testSuccess() throws Exception
    {
        ContentType ct = new ContentType("text/html");
        PrintWriter pw = newPrintWriter();
        WebResponse response = newWebResponse(ct, pw);
        IMarkupWriter nested = newNestedWriter();

        MockControl control = newControl(IMarkupWriter.class);
View Full Code Here

            // provide it, try and guess it by the extension.

            if (contentType == null || contentType.length() == 0)
                contentType = getMimeType(resourcePath);

            OutputStream output = _response.getOutputStream(new ContentType(contentType));

            input = new BufferedInputStream(resourceConnection.getInputStream());

            byte[] buffer = new byte[BUFFER_SIZE];
View Full Code Here

    {
        cycle.activate(pageName);

        IPage page = cycle.getPage();

        ContentType contentType = page.getResponseContentType();

        PrintWriter printWriter = _response.getPrintWriter(contentType);

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

       
        // do not squeeze on output either
        Object[] args = cycle.getServiceParameters();
        String strArgs = generateOutputString(args);
        if (strArgs != null) {
          OutputStream output = _response.getOutputStream(new ContentType("text/xml"));
          output.write(strArgs.getBytes("utf-8"));
        }
  }
View Full Code Here

    }

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

        IMarkupWriter writer = new MarkupWriterImpl("text/html", pw, new AsciiMarkupFilter());

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

    {try { __CLOVER_1_0.M[62]++;
        __CLOVER_1_0.S[185]++;if ((((translatorSource == null || contentType == null || encoding == null) && (++__CLOVER_1_0.CT[43] != 0)) || (++__CLOVER_1_0.CF[43] == 0))){
            __CLOVER_1_0.S[186]++;throw new IllegalArgumentException(
                Tapestry.getMessage("AbstractMarkupWriter.missing-constructor-parameters"));}

        __CLOVER_1_0.S[187]++;ContentType contentTypeObject = generateFullContentType(contentType, encoding);
        __CLOVER_1_0.S[188]++;_contentType = contentTypeObject.unparse();
       
        __CLOVER_1_0.S[189]++;encoding = contentTypeObject.getParameter("charset");
        __CLOVER_1_0.S[190]++;_translator = translatorSource.getTranslator(encoding);
       
        __CLOVER_1_0.S[191]++;setOutputStream(stream, encoding);
    } finally { }}
View Full Code Here

        String contentType,
        OutputStream stream)
    {
        this(translatorSource, contentType);__CLOVER_1_0.S[192]++;try { __CLOVER_1_0.M[63]++;

        __CLOVER_1_0.S[193]++;ContentType contentTypeObject = new ContentType(contentType);
        __CLOVER_1_0.S[194]++;String encoding = contentTypeObject.getParameter("charset");

        __CLOVER_1_0.S[195]++;setOutputStream(stream, encoding);
    } finally { }}
View Full Code Here

    {try { __CLOVER_1_0.M[65]++;
        __CLOVER_1_0.S[199]++;if ((((translatorSource == null || contentType == null) && (++__CLOVER_1_0.CT[44] != 0)) || (++__CLOVER_1_0.CF[44] == 0))){
            __CLOVER_1_0.S[200]++;throw new IllegalArgumentException(
                Tapestry.getMessage("AbstractMarkupWriter.missing-constructor-parameters"));}

        __CLOVER_1_0.S[201]++;ContentType contentTypeObject = generateFullContentType(contentType, DEFAULT_ENCODING);
        __CLOVER_1_0.S[202]++;_contentType = contentTypeObject.unparse();
       
        __CLOVER_1_0.S[203]++;String encoding = contentTypeObject.getParameter("charset");
        __CLOVER_1_0.S[204]++;_translator = translatorSource.getTranslator(encoding);
    } finally { }}
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.