I m trying to use <jsp:include page> with apache tomcat 5.5.26 as follows

679:</table>
680:	</td></tr>
681:	<tr><td colspan=2 width="100%">
682:		<jsp:include page="html/policy.html" flush="true"/>
683:	</td></tr>
684:	<tr><td colspan = 2 align="center">
685:		<input type="hidden" name="hide" value="3">

where policy.html is html file to display policy.
while trying to view jsp i m getting following error

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 682 in the jsp file: /PreReqMail.jsp
org.apache cannot be resolved or is not a field
679:</table>
680:	</td></tr>
681:	<tr><td colspan=2 width="100%">
682:		<jsp:include page="html/policy.html" flush="true"/>
683:	</td></tr>
684:	<tr><td colspan = 2 align="center">
685:	<input type="hidden" name="hide" value="3">


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

can any one help me?

The <jsp:include tag includes the runtime result of executing another JSP into the one it's contained in.
As your page is a static page, not a JSP, it won't compile to a Java servlet, which is what the error indicates.
Make it a JSP and try again.

hello. there isn't any problem in your syntax or code. but you probably hadn't written this code into a jsp file in a web project:) just start a new web project...

This article has been dead for over six months. Start a new discussion instead.