報錯的log java
嚴重: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Invalid syntax for function signature in TLD. Tag Library: 某某某, Function: xxxx at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:165) at org.apache.jasper.compiler.Validator$ValidateVisitor.getMethod(Validator.java:1643) at org.apache.jasper.compiler.Validator$ValidateVisitor.processSignature(Validator.java:1630) at org.apache.jasper.compiler.Validator$ValidateVisitor.access$400(Validator.java:418) at org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1606) at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:139) at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214) at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:256) at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:61) at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214) at org.apache.jasper.compiler.Validator$ValidateVisitor.validateFunctions(Validator.java:1610) at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1381) at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1231) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:876) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450) at org.apache.jasper.compiler.Node$Root.accept(Node.java:474) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1845) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:218) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657) at org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:240) at org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:578) at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:49) at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:655) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444) at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:659) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444) at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:659) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444) at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:659) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450) at org.apache.jasper.compiler.Node$Root.accept(Node.java:474) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:673) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:230) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657) at org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:240) at org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:578) at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:49) at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:655) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450) at org.apache.jasper.compiler.Node$Root.accept(Node.java:474) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) at org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:673) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:230) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
錯誤的.tld文件 function:encodeUrl apache
<function> <description> Encodes given URL </description> <name>encodeUrl</name> <function-class>xx.xxxxx.xxxxxx.xxxxxxxxxx.tags.Functions</function-class> <function-signature>java.lang.String encodeUrl(java.lang.String)</function-signature> </function>
修改後的 function app
<function> <description> Encodes given URL </description> <name>encodeUrl</name> <function-class>xx.xxxxx.xxxxxx.xxxxxxxxxx.tags.Functions</function-class> <function-signature>java.lang.String encodeUrl(java.lang.String)</function-signature> </function>
對不發現function jsp
1.錯誤的 函數
<function-signature>返回值類型 spa
方法名(參數)</function-signature> code
2.改正後的 ip
<function-signature>返回值類型 方法名(參數)</function-signature> get
原 來function-signature標籤裏面,函數聲明跟返回類型必須在同一行,都是習慣Ctrl+Shift+F惹的禍!