tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Hanik" <Filip.Ha...@evant.com>
Subject RE: include .inc file extension problem
Date Sat, 08 Feb 2003 01:49:51 GMT
if it is a .inc file, don't you want to use the static include (ie, before it gets compiled)

http://java.sun.com/products/jsp/syntax/1.1/syntaxref117.html#8772

that way, the include is only called one, and compiled into your JSP
Filip

-----Original Message-----
From: Austin King [mailto:cruftworks@yahoo.com]
Sent: Friday, February 07, 2003 5:45 PM
To: tomcat-user@jakarta.apache.org
Subject: jsp:include .inc file extension problem


I am porting an asp site to struts and found some
weird behavior around jsp:include and the .inc file
extension. I applogise if this is obvious, and I
couldn't find any references to this previously. Try
this at home...
<%-- test.jsp --%>
<html>
<body>
<jsp:include page="foo.inc"/>
</body>
</html>

create text file foo.inc that contains text hello
world

browse to test.jsp and you get
java.lang.IllegalStateException
	at
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:109)

now move foo.inc to foo.txt and change jsp:include to
<jsp:include page="foo.txt" />

it works and you see hello world.
Why? Here is a snippet form test$jsp.java servlet 

          // begin
[file="/test/test.jsp";from=(7,0);to=(7,36)]
              {
                  String _jspx_qStr = "";
                  JspRuntimeLibrary.include(request,
response, "BannerBody.inc" + _jspx_qStr, out, false);
                  if
("true".equals(request.getAttribute("javax.servlet.forward.seen")))
                      return;
              }
          // end

This was reproducable on tomcat 4.0.4(solaris) and
4.0.6(linux). I didn't know that jsp:include
(RequestDispatch.include) was smart about file
extensions. What am I missing here?

Here is the entire exception
Apache Tomcat/4.0.6 - HTTP Status 500 - Internal
Server Error

type Exception report

message Internal Server Error

description The server encountered an internal error
(Internal Server Error) that prevented it from
fulfilling this request.

exception 

java.lang.IllegalStateException
	at
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:109)
	at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1164)
	at
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:525)
	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.test$jsp._jspService(test$jsp.java:216)
	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.valves.AccessLogValve.invoke(AccessLogValve.java:468)
	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.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
	at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
	at java.lang.Thread.run(Thread.java:536)

=====
Austin King

http://www.cruftworks.com/

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message