Package org.apache.tapestry.util

Examples of org.apache.tapestry.util.ContentType


    public void renderResponse(IRequestCycle cycle)
        throws IOException
    {
        _localeManager.persistLocale();

        ContentType contentType = new ContentType(CONTENT_TYPE + ";charset=" + cycle.getInfrastructure().getOutputEncoding());

        String encoding = contentType.getParameter(ENCODING_KEY);

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

            contentType.setParameter(ENCODING_KEY, encoding);
        }

        if (_writer == null) {

            parseParameters(cycle);
View Full Code Here


           
            return;
        }
       
        _localeManager.persistLocale();
        _contentType = new ContentType(CONTENT_TYPE + ";charset=" + cycle.getInfrastructure().getOutputEncoding());
       
        String encoding = _contentType.getParameter(ENCODING_KEY);
       
        if (encoding == null)
        {
View Full Code Here

           
            _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);
           
            _writer = _markupWriterSource.newMarkupWriter(printWriter, contentType);
View Full Code Here

        // force image(or other) caching when detected, esp helps with ie related things
        // see http://mir.aculo.us/2005/08/28/internet-explorer-and-ajax-image-caching-woes
       
        _response.setContentLength(data.length);
       
        OutputStream output = _response.getOutputStream(new ContentType(contentType));
       
        output.write(data);
    }
View Full Code Here

        expect(request.getHeader("User-Agent")).andReturn("Mozilla").anyTimes();

        response.setHeader("ETag", "W/\"" + url.getContentLength() + "-" + url.getLastModified() + "\"");
        response.setContentLength(url.getContentLength());

        expect(response.getOutputStream(new ContentType("image/png"))).andReturn(new ByteArrayOutputStream());

        replay();

        service.service(cycle);
View Full Code Here

            return;
        }

        StringWriter sWriter = new StringWriter();
        IMarkupWriter nested = getMarkupWriterSource().newMarkupWriter(new PrintWriter(sWriter),
                                                                       new ContentType(writer.getContentType()));

        nested.begin("style");
        nested.attribute("type", "text/css");

        if (getMedia()!=null)
View Full Code Here

            return;
        }

        _localeManager.persistLocale();
        _contentType = new ContentType(CONTENT_TYPE + ";charset=" + cycle.getInfrastructure().getOutputEncoding());

        String encoding = _contentType.getParameter(ENCODING_KEY);

        if (encoding == null)
        {
View Full Code Here

    public void renderResponse(IRequestCycle cycle)
      throws IOException
    {
        _localeManager.persistLocale();

        ContentType contentType = new ContentType(CONTENT_TYPE + ";charset=" + cycle.getInfrastructure().getOutputEncoding());

        String encoding = contentType.getParameter(ENCODING_KEY);

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

            contentType.setParameter(ENCODING_KEY, encoding);
        }

        if (_writer == null)
        {
            parseParameters(cycle);
View Full Code Here

        {
            _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);

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

        String contentType,
        OutputStream stream)
    {
        this(safe, entities, contentType);

        ContentType contentTypeObject = new ContentType(contentType);
        String encoding = contentTypeObject.getParameter("charset");

        setOutputStream(stream, encoding);
    }
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.