异常javax.el.ELException: The identifier [float] is not a valid Java identifier

阅读更多

只有Tomcat7.X才会出现此错误。

 

 

今天使用Struts 2 极速表单验证框架:https://code.google.com/p/struts-plus/

 

jsp代码:

浮点数字范围(1~10):
访问jsp报异常 
javax.el.ELException: The identifier [float] is not a valid Java identifier as required by section 1.19 of the EL specification (Identifier ::= Java language identifier). This check can be disabled by setting the system property org.apache.el.parser.SKIP_IDENTIFIER_CHECK to true.
org.apache.el.parser.AstDotSuffix.setImage(AstDotSuffix.java:46)
org.apache.el.parser.ELParser.DotSuffix(ELParser.java:1067)
org.apache.el.parser.ELParser.ValueSuffix(ELParser.java:1033)
org.apache.el.parser.ELParser.Value(ELParser.java:978)
org.apache.el.parser.ELParser.Unary(ELParser.java:948)
org.apache.el.parser.ELParser.Multiplication(ELParser.java:712)
org.apache.el.parser.ELParser.Math(ELParser.java:632)
org.apache.el.parser.ELParser.Compare(ELParser.java:444)
org.apache.el.parser.ELParser.Equality(ELParser.java:338)
org.apache.el.parser.ELParser.And(ELParser.java:282)
org.apache.el.parser.ELParser.Or(ELParser.java:226)
org.apache.el.parser.ELParser.Choice(ELParser.java:183)
org.apache.el.parser.ELParser.Expression(ELParser.java:175)
org.apache.el.parser.ELParser.DynamicExpression(ELParser.java:147)
org.apache.el.parser.ELParser.CompositeExpression(ELParser.java:44)
org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:116)
org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:172)
org.apache.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:217)
org.apache.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:67)
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:984)
org.apache.jsp.form_005fjs_jsp._jspService(form_005fjs_jsp.java:115)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)
 

 

原因: ${param.float}  中float 是el表达式的关键字

解决方法: ${param.float} 改为${param["float"]}

 

 

解决方法来源:http://stackoverflow.com/questions/6233473/javax-el-elexception-the-identifier-return-is-not-a-valid-java-identifier

 

 

 

你可能感兴趣的:(EL,Exception,struts-plus)