tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@apache.org>
Subject Re: TC 7.0.16 IllegalStateException thrown by pageContext.include
Date Fri, 24 Jun 2011 12:08:58 GMT
Looks like this is the root cause from DefaultServlet ...

While the ISE is caught ... since the mimetype for js was changed - it
doesn't match the fallback method ....

            try {
                ostream = response.getOutputStream();
            } catch (IllegalStateException e) {
                // If it fails, we try to get a Writer instead if we're
                // trying to serve a text file
                if ( (contentType == null)
                        || (contentType.startsWith("text"))
                        || (contentType.endsWith("xml")) ) {
                    writer = response.getWriter();
                    // Cannot reliably serve partial content with a Writer
                    ranges = FULL;
                } else {
                    throw e;
                }
            }

So one patch is this (which will catch all javascript variants if multiple
exist)
                if ( (contentType == null)
                        || (contentType.startsWith("text"))
                        || (contentType.endsWith("xml"))
+                        || (contentType.contains("/javascript")) ) {


-Tim

On Thu, Jun 23, 2011 at 9:12 PM, David Wall <d.wall@computer.org> wrote:

> This was working under TC 6, but I have a tag that extends BodyTagSupport,
> and in my doStartTag() method I get my JspWRiter 'out' using
> pageContext.getOut().
>
> I have a bunch of out.write("") statements that all work fine.
>
> Then I have these:
>
> out.write("<style type=\"text/css\">\n/* platform esf.css */\n");
> pageContext.include("/static/**esf/esf.css",true);
> pageContext.include(docPage.**context.**getDocumentStyleIncludeUrl(),**
> true);
> out.write("</style>\n");
>
> out.write("<script type=\"text/javascript\">\n");
> pageContext.include("/static/**esf/esf.js",true);
> out.write("</script>\n");
>
> But the exception IllegalStateException is thrown on the include of the
> esf.js file.  The reason is null, so there's no more details.  I find it odd
> in that the two prior includes works okay, but that third one fails.  The
> file is definitely there (and has been working under TC 6.0 before).
>
> If I comment out that include, my tag works fine.  What might be causing
> this?
>
> Thanks,
> David
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<users-unsubscribe@tomcat.apache.org>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message