-
Bug
-
Resolution: Done
-
Blocker
-
7.2.4.GA
Even if defined JavaBeans using <jsp:useBean> in jsp, the EL expression is handled as java Class if that class is already imported in jsp.
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="test.TestMBean"%> <html> <head> <title>Test1</title> </head> <body> <jsp:useBean id="TestMBean" class="test.TestMBean"/> TestMBean.test : ${TestMBean.test} <br/> </body> </html>
Therefore, the following exceptions may occur:
Caused by: javax.el.PropertyNotFoundException: Either 'test' is not a public static field of the class 'test.TestMBean' or field is inacessable at javax.el.StaticFieldELResolver.getValue(StaticFieldELResolver.java:107) at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110) at com.sun.el.parser.AstValue.getValue(AstValue.java:139) at com.sun.el.parser.AstValue.getValue(AstValue.java:203) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:917) at org.apache.jsp.test1_jsp._jspService(test1_jsp.java:107) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:791) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) ... 46 more
According EL spec, Evaluating of the imported static field should be the last.
1.5.1 Evaluating Identifiers
The steps are used for evaluating an identifier.
■ If the identifier is a lambda argument passed to a lambda expression invocation, its value is returned.
■ Else if the identifier is a variable, the associated expression is evaluated and returned.
■ Else if the identifier is resolved by the ELResolvers, the value returned from the ELResolvers is returned.
■ Else if the identifier is an imported static field, its value is returned.
■ Else return not resolved.
One implication of the explicit search order of the identifiers is that an identifier hides other identifiers (of the same name) that come after it in the list.
- clones
-
WFLY-12650 EL does not handle identifiers as JavaBeans
- Closed
- is cloned by
-
JBEAP-17730 [GSS](7.2.z) WFLY-12650 - Does not handle EL expression as JavaBeans
- Closed