On 24.06.2011 03:47, David Wall wrote: > >> >>> 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). >> >> When I change the code to use /static/esf/esf.javascript and rename >> the file to have the same suffix, the exception is not thrown. >> >> Is there anything special about the .js suffix on a file for >> pageContext.include()? > > Okay, I learned that this is because web.xml for TC 6 uses: > > <mime-mapping> > <extension>js</extension> > <mime-type>text/javascript</mime-type> > </mime-mapping> > > But TC 7 uses: > > <mime-mapping> > <extension>js</extension> > <mime-type>application/javascript</mime-type> > </mime-mapping> > > If I put the old TC 6 version in my app's web.xml, then it works again. > > Question: Is this to be expected? Is TC 7 doing the "right thing" > here? Am I breaking something when I update my app's web.xml to say > it's 'text' again? > > Seems like javascript is really text, and so treating as something else > is not correct, even if the mime type is correctly supposed to be > application/javascript. Maybe TC needs to "know" this particular mime > type is text and not binary data?
We synced all mime types with the definitions from the Apache Web Server. Looking at the IANA MIME type registry http://www.iana.org/assignments/media-types/index.html you can verify, that they list text/javascript as "obsolete" and application/javascript without restriction. So from a standards point of view it is the "right" thing, maybe not for usability? Regards, Rainer --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org