tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sukhwinder Singh" <punjabim...@rediffmail.com>
Subject jsp include problem
Date Mon, 19 Nov 2001 19:41:03 GMT

Hello,
	I am using tomcat 4.01 on Windows 95.
I have a simple jsp file and its contents are:

/////////////////////////////////

<%@ page contentType="text/xml"%>
<jsp:include page="portfolio.xml" />

/////////////////////////////////

and portfolio.xml's contents are:
//////////////////////////////////
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="portfolio.xsl"?>
<portfolio>
	<stock>
		<symbol>SUNW</symbol>
		<name>Sun MicroSystems Inc.</name>
		<price>15.2</price>
	</stock>
	<stock>
		<symbol>IBM</symbol>
		<name>International Business Machines</name>
		<price>50.2</price>
	</stock>
	<stock>
		<symbol>MS</symbol>
		<name>Microsoft Corporation</name>
		<price>99.99</price>
	</stock>
</portfolio>
/////////////////////////////////////

Whenever I access this file following exception is thrown. This problem doesn't arise when
I use Resin web server.

////////////////////////////////////////////////////////
Apache Tomcat/4.0.1 - 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:1143)
	at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:1125)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:570)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:493)
	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:818)
	at org.apache.jsp.xmljsp$jsp._jspService(xmljsp$jsp.java:60)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
	at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
	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:201)
	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:2344)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	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:462)
	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:163)
	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:1011)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
	at java.lang.Thread.run(Thread.java:579)

///////////////////////////////////////////////////////////
If I use flush=true like this:
<jsp:include page="portfolio.xml" flush="true"/>
then problem doesn't arise but Internet explorer displays this error:

//////////////////////////////////////////////
The XML page cannot be displayed 
Cannot view XML input using style sheet.
Please correct the error and then click the Refresh button, or try again later. 
--------------------------------------------------------------------------------

XML document must have a top level element. 
//////////////////////////////////////////////// 

I think it is unable to find portfolio.xsl.
How can this page find xsl file.

Sukhwinder Singh 


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message