August 3, 2009

JSP: Unterminated <% tag

Topic:  JSP 2.0

Application Server: JBoss 4.0.2 / Tomcat 5.5.9

Exception:

org.apache.jasper.JasperException: /Test.jsp(1,1) Unterminated <%@ page tag
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:130)
	org.apache.jasper.compiler.Parser.parseDirective(Parser.java:511)
	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1543)
	org.apache.jasper.compiler.Parser.parse(Parser.java:126)
	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
	org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

Resolution:

A JSP element closing tag, the combination of % and > characters without whitespace between them is missing. Make sure the tags in the JSP are matched and that they are not inter-nested (a JSP element within another JSP element) or there is no whitespace between the 2 closing tag characters.

1 comment:

  1. in my case this happened when after imports libraries to jsp I accidentally added ";" after one of import

    ReplyDelete