Package org.apache.tapestry.util

Examples of org.apache.tapestry.util.ContentType


        // 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


           
            _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

    {
        cycle.activate(pageName);

        IPage page = cycle.getPage();
       
        ContentType contentType = page.getResponseContentType();
        PrintWriter printWriter = _response.getPrintWriter(contentType);
        IMarkupWriter writer = _markupWriterSource.newMarkupWriter(printWriter, contentType);
        String namespace = _response.getNamespace();
       
        IMarkupWriter nested = writer.getNestedWriter();
View Full Code Here

   
    protected void renderStyleTag(Shell shell, IMarkupWriter writer, IRequestCycle cycle)
    {
        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)
            nested.attribute("media", getMedia());
        if (getTitle()!=null)
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

        PortletWebResponse pwr = new PortletWebResponse(response);

        try
        {
            pwr.getOutputStream(new ContentType("foo/bar"));
            unreachable();
        }
        catch (UnsupportedOperationException ex)
        {
            // Expected.
View Full Code Here

        try {
            _response.setDateHeader("Expires", EXPIRES);
            _response.setHeader("Cache-Control", "public, max-age=" + (MONTH_SECONDS * 3));
            _response.setContentLength(data.length);

            os = _response.getOutputStream(new ContentType("image/" + type));

            os.write(data);

        finally {
            try {
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

        // do not squeeze on output either
        Object[] args = cycle.getListenerParameters();
        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

    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

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.