JavaWeb项目org.apache.jasper.JasperException: 解决方法

JavaWeb项目org.apache.jasper.JasperException: 解决方法_第1张图片

在做项目时候,遇到这个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版本不够高,不支持以下代码这样下,因此不断报错。

解决方法:

(1)我是用tomcat6.0运行的,不断地提示错误代码,但是并没有错的。

报错代码贴出来,但是在我的myeclipse是可以运行:
 
        
       
         
       

       
       
       
       
       
       
       
       
      
         
        

(2)改用tomcat7.0,成功运行,完美解决了这个问题。

你可能感兴趣的:(javaWeb)

新闻id标题类别作者浏览量时间照片路径内容