I'm not sure about the compile warning. I think it has to do with mime types needing to be decalred in web.xml.
For example: I have the following pages: foo.jsp with the contents ---------------------------------------------------------------- hello <jsp:include flush='false' page="foo1.timisastoopidhead"/> ---------------------------------------------------------------- And the file foo1.timisastoopidhead exists. And voila - I get the wacky exception. BUT if add the following to web.xml: <mime-mapping> <extension>timisastoopidhead</extension> <mime-type>text/plain</mime-type> </mime-mapping> And restart tomcat (not reload, restart) - all is ok. So the moral of the story seems - register you file extension/mime type in web.xml if you want to include it as a file. Erick Todd wrote: > The second one works, however it does write a warning to the logs that > the JSPNote javac.main has been depracated. Do you know why that is? > So I would say that something is wrong with jsp:include. However I > really don't want to rewrite every jsp:include across all of my jsp > pages!! > > Any idea why the straight include won't work? Hey I really appreciate > all the help here!! > > Or should I consider getting the source, rewriting jsp:include and > re-compile?!? > > Erick > > On Tue, 2002-09-17 at 10:51, Tim Funk wrote: > >>I can reproduce this - strange. Can you try either of the following: >> >>---------------------------------------------------------------- >><%String largeAd="/includes/468x60ad.txt";%> >><jsp:include page="<%=largeAd%>" flush="true"/> >>---------------------------------------------------------------- >>OR >>---------------------------------------------------------------- >> InputStream ps = >>application.getResourceAsStream("/includes/468x60ad.inc"); >> if (ps!=null) { >> byte[] buffer = new byte[1024]; >> int read = ps.read(buffer); >> while (read>0) { >> out.print(new String(buffer, 0, read)); >> read = ps.read(buffer); >> } >> ps.close(); >> } >>---------------------------------------------------------------- >> >> >>Erick Todd wrote: >> >>>Ok here is more info. These pages all work on tomcat 3 right now. I >>>have stripped down the page to the bare problem and still get the error. >>> >>>I downgraded to Tomcat 4.0.4 because 4.1.10 has a problem doing regular >>>static include across a symbolic link. But for this problem of dynamic >>>including, I have to use jsp:include because the String largeAd actually >>>comes from a parent page. But even in this simple situation, nothing >>>works. What am I doing wrong, configuration, JVM?? >>> >>>I use the jdk1.4.1. If I change the jsp:include to a <%@ include . .. >>>Everything works fine, but I have to be able to pass the string into the >>>include, so I have to use jsp:include. >>>Again, this works in all the older tomcats. I just now upgrade from 3.2 >>>to 4.0.4. >>> >>>Lastly, I am on redhat linux 7.0 and 7.3 >>> >>>Here is the jsp page. Down to only 2 lines. >>><%String largeAd="/includes/468x60ad.inc";%> >>><jsp:include page="<%=largeAd%>" flush="true"/> >>> >>>The contents of /includes.468x60ad.inc are just 5 lines of >>>html/javascript. >>> >>>That's it. I use mod_jk, (jk1) do a JkMount for the virtual host for >>>*.jsp. The server xml for this domain is: >>> <Host name="cscom2.coloradosprings.com"> >>> <Context path="" docBase="/www/sites/cscom/cscom" debug="0" >>>reloadable="true" > >>> </Context> >>> </Host> >>> >>>And finally the stack trace from the log is: >>> >>>2002-09-17 10:20:59 StandardWrapperValve[jsp]: Servlet.service() for >>>servlet jsp threw exception >>>java.lang.IllegalStateException >>> at >>>org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:109) >>> at >>>org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1146) >>> at >>>org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) >>> at >>>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683) >>> at >>>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574) >>> at >>>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497) >>> at >>>org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:819) >>> at org.apache.jsp.index$jsp._jspService(index$jsp.java:63) >>> at >>>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) >>> at >>>org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201) >>> at >>>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) >>> at >>>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) >>> at >>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) >>> at >>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) >>> at >>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) >>> at >>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) >>> at >>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) >>> at >>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) >>> at >>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190) >>> at >>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) >>> at >>>org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) >>> at >>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) >>> at >>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) >>> at >>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) >>> at >>>org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347) >>> at >>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) >>> at >>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) >>> at >>>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) >>> at >>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) >>> at >>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) >>> at >>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) >>> at >>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) >>> at >>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) >>> at >>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) >>> at >>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) >>> at >>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) >>> at >>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) >>> at >>>org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458) >>> at >>>org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551) >>> at java.lang.Thread.run(Thread.java:536) >>> >>>On Tue, 2002-09-17 at 09:38, Tim Funk wrote: >>> >>> >>>>Like in a previous reply to this post - we need more information (like a >>>>code snippet) in order to provide a better answer. >>>> >>>>You allude to "Illegal State Exception". This can happen if you try any >>>>of the following: >>>>- Attempt to set headers (like cookies) inside of a jsp:include >>>>- Attempt a JSP forward inside of a jsp:include >>>>- Probably another reason I can't think of right now >>>> >>>> >>>>Erick Todd wrote: >>>> >>>> >>>>>This isn't a SSI include. It is a jsp include native to the jsp >>>>>specification? I did enable SSI just for kicks, but it doesn't change >>>>>anything. >>>>> >>>>>Anyone?? I am really frustrated. What do I need to do to get rid of >>>>>the Illegal State Exception on a jsp:include? >>>>> >>>>>I include on the first line, later, nested includes, none of them work. >>>>> >>>>>HELP!! >>>>> >>>>>On Mon, 2002-09-16 at 21:40, Robert L Sowders wrote: >>>>> >>>>> >>>>> >>>>>>Did you follow directions? >>>>>>http://jakarta.apache.org/tomcat/tomcat-4.1-doc/ssi-howto.html >>>>>> >>>>>>rls >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>Erick Todd <[EMAIL PROTECTED]> >>>>>>09/16/2002 01:30 PM >>>>>>Please respond to "Tomcat Users List" >>>>>> >>>>>> >>>>>> To: Tomcat Users List <[EMAIL PROTECTED]> >>>>>> cc: >>>>>> Subject: JSP Include error >>>>>> >>>>>>Anyone had any problems with doing a <jsp:include> ?? >>>>>> >>>>>>It justs throws an unknown error, not even to the screen. >>>>>> >>>>>>Anything I do with an jsp:include doesn't work. >>>>>> >>>>>>Ideas?? >>>>> >> >>-- >>To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> >> > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>