You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2000/10/05 08:29:43 UTC
Re: Tomcat 4 and including HTML files
Elijah Roberts wrote:
> I just installed Tomcat 4 to try it out and I'm experiencing a slight
> problem with it. In some of my JSPs I use
>
> <jsp:include page="/include/header.html" flush="true" />
>
> To include a standard header at the top of all the pages. It worked fine
> in Tomcat 3.1, but not in Tomcat 4. If I change it to
>
> <jsp:include page="/include/header.jsp" flush="true" />
>
> and rename the .html file as .jsp, it once again works fine. The
> following exception is getting thrown in the log whenever a file
> including the .html file gets called:
>
Yep. You've run into a known bug in the current implementation. This will be addressed before the
final release of Tomcat 4.0. In the interim, a workaround is to convert your standard headers (and
footers, if any) to JSP pages (with a ".jsp" extension) instead of being static HTML files.
>
> >2000-09-30 17:01:11 ApplicationDispatcher[] Servlet.service() for servlet default threw exception
> >java.lang.IllegalStateException: getWriter() has already been called for this response
> > at org.apache.catalina.connector.ResponseBase.getOutputStream(ResponseBase.java:598)
> > at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:123)
> > at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1060)
> > at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:312)
> > 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:501)
> > at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:412)
> > at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:411)
>
> I assume it means that the DefaultServlet is using the OutputStream after
> the Writer has already been used causing the exception. So my question
> is, is it legal to include HTML files like that, or should one only
> include jsp files? Or is this something that will/needs to be fixed?
>
> Elijah Roberts
> eroberts@alexandriasc.com
Craig McClanahan
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00): Sun Technical Briefing
Session T06 (24-Oct 14h00-15h00): Migrating Apache JServ
Applications to Tomcat