在做项目时候,遇到这个500错误。找了很久,jsp写法也没错误,在本地myeclipse可以运行,在别人的myeclipse不能运行,最后终于解决了,是tomcat的版本问题。
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: /PCManage/controlsecletthenews.jsp(303,12) The function getNid must be used with a prefix when a default namespace is not specified org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1506) org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:129) org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:200) org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:242) org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:56) org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:200) org.apache.jasper.compiler.Validator$ValidateVisitor.validateFunctions(Validator.java:1531) org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1176) org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:846) org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:865) org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417) org.apache.jasper.compiler.Node$Root.accept(Node.java:495) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1763) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198) org.apache.jasper.compiler.Compiler.compile(Compiler.java:347) org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) org.apache.jasper.compiler.Compiler.compile(Compiler.java:314) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) serlvet.SearchNewsServlet.doPost(SearchNewsServlet.java:79) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.
原因;是tomcat6.0版本不够高,不支持以下代码这样下,因此不断报错。
解决方法:
<tr><td>新闻id</td><td>标题</td><td>类别</td><td>作者</td><td>浏览量</td><td>时间</td><td>照片路径</td><td>内容</td></tr>
<c:forEach items=”${project_vector}” var=”vector” varStatus=”status”>
<tr>
<td><c:out value=”${vector.getNid()}”/></td>
<td><c:out value=”${vector.getNbiaoti()}”/></td>
<td><c:out value=”${vector.getNleixing()}”/></td>
<td><c:out value=”${vector.getNzuozhe()}”/></td>
<td><c:out value=”${vector.getNliulangliang()}”/></td>
<td><c:out value=”${vector.getNdate()}”/></td>
<td><img style=”height:30px;width:30px;background:blue” src=”<%=request.getContextPath() %>${vector.getNphotepath()}” alt=””/></td><!– <c:out value=”${vector.getNphotepath()}”/> –>
<td><c:out value=”${vector.getNtext()}”/></td>
</tr>
</c:forEach>
今天的文章JavaWeb项目org.apache.jasper.JasperException: 解决方法分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/27615.html