程序在部署的時候,出現的jsp異常,
詳細的異常日志
org.apache.jasper.JasperException: /admin/account/queryAccount.jsp(15,2) According to TLD or attribute directive in tag file, attribute test does not accept any expressions at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1186) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417) at org.apache.jasper.compiler.Node$Root.accept(Node.java:495) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1785) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
多的我就不粘了
我感覺出這個問題是由於jstl庫的問題,當我們使用JSTL一定要引入(jstl standard 兩個包),然后就是版本的問題了,就是jsp的版本和jstl的兼容不好吧
最后的解決方式是
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
替換成這個
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
就可以成功跑出頁面 很開心
追加,貌似替換成這個導入也沒有問題
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>