日期:2014-05-20  浏览次数:20925 次

JSP出现了Unterminated <%@ page tag错误
我用的标签库JSP是taglibs.jsp,代码如下
<%@ page contentType="text/html"; language="java"%>

<%@taglib uri="WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="WEB-INF/struts-logic.tld" prefix="logic"%>

<%@ page errorpage="/errorpage.jsp"%>
然后在主页InsertNewNotice.jsp引用了标签jsp文件.
<%@ page language="java" pageEncoding="gb2312"%>
<%@ include file="taglibs.jsp"%>
<%@ include file="header.jsp"%>
<html:errors/>
<html:form action="/InsertNewNotice.do" focus="title">
<center>
<table border="0" cellspacing="2" cellpadding="2" width="100%">
<tr>
<td width="40%" align="right"><bean:message key="InsertNewNotice.title"/></td>
<td width="60%"><html:text property="title"/></td>
</tr>
<tr>
<td align="right"><bean:message key="InsertNewNotice.content"/></td>
<td><html:textarea property="content"/></td>
</tr>
<tr>
<td align="right">
<html:submit property="submit">
<bean:message key="InsertNewNotice.submit"/>
</html:submit>
</td>
<td align="left">
<html:reset>
<bean:message key="InsertNewNotice.reset"/>
</html:reset>
</td>
</tr>
</table>
</center>
</html:form>
<%@ include file="footer.jsp"%>

结果运行出现HTTP Status 500 错误.
type Exception report

message 

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

exception 

org.apache.jasper.JasperException: /InsertNewNotice.jsp(2,0) /taglibs.jsp(1,1) Unterminated &lt;%@ page tag
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:90)
org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:339)
org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:372)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

貌似是标签的问题,就是不知道问题出在哪里.

------解决方案--------------------