EL表達式報錯: According to TLD or attribute directive in tag file, attribute value does not accept any ex

EL表達式報錯: According to TLD or attribute directive in tag file, attribute value does not accept any expressions: java

在導入頁面時,報以下錯誤: express

 嚴重: Servlet.service() for servlet jsp threw exception apache

org.apache.jasper.JasperException: /out.jsp(32,10) According to TLD or attribute directive in tag file, attribute value does not accept any expressions jsp

at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) spa

at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) get

at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) 源碼

at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1186) servlet

at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840) it

at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) io

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)

 

查看源碼是el表達式有引入空值${null} ,因此報錯;

更改下引入jstl標籤庫

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

改爲

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>

 

這樣${null},就不會報錯,而且打印成空值



相關文章
相關標籤/搜索