Package org.apache.tapestry.internal.util

Examples of org.apache.tapestry.internal.util.ContentType


    private ContentType findResponseContentType(Page page)
    {
        ComponentResources pageResources = page.getRootComponent().getComponentResources();

        String contentTypeString = _metaDataLocator.findMeta(TapestryConstants.RESPONSE_CONTENT_TYPE, pageResources);
        ContentType contentType = new ContentType(contentTypeString);

        // Make sure thre's always a charset specified.

        String encoding = contentType.getParameter(CHARSET);
        if (encoding == null)
        {
            encoding = _metaDataLocator
                    .findMeta(TapestryConstants.RESPONSE_ENCODING, pageResources);
            contentType.setParameter(CHARSET, encoding);
        }

        return contentType;
    }
View Full Code Here


        _pageRenderQueue.initializeForPartialPageRender(rootRenderCommand);

        // This may be problematic as the charset of the response is not
        // going to be set properly I think.  We'll loop back to that.

        ContentType contentType = new ContentType("text/javascript");

        MarkupWriter writer = _factory.newMarkupWriter();

        JSONObject reply = new JSONObject();

        // ... and here, the pipeline eventually reaches the PRQ to let it render the root render command.

        _partialMarkupRenderer.renderMarkup(writer, reply);

        PrintWriter pw = _response.getPrintWriter(contentType.toString());

        pw.print(reply);

        pw.flush();
    }
View Full Code Here

        ComponentResources pageResources = page.getRootElement().getComponentResources();

        String contentTypeString = _locator.findMeta(
                TapestryConstants.RESPONSE_CONTENT_TYPE,
                pageResources);
        ContentType contentType = new ContentType(contentTypeString);

        String encoding = contentType.getParameter("charset");

        if (encoding == null)
            encoding = _locator.findMeta(TapestryConstants.RESPONSE_ENCODING, pageResources);

        _request.setEncoding(encoding);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.internal.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.