The problem
We had several customers who reported the same issue last week through MetaLink. I see that others also created a Forum thread:
JSP pages with JSTL including EL gives the following error at compilation in JDeveloper 10.1.3:
Error(<line number="">): Expression Language not supported in compile time attribute value
</line>
or the following when running the page in OC4J:500 Internal Server Error
OracleJSP: oracle.jsp.parse.JspParseException: /Name.jsp: Line # 13, <c:out value="Hello, my name is ${LastName}, ${FirstName} ${LastName}">
Error: Expression Language not supported in compile time attribute value</c:out>The same pages could compile and run without any problem with JDeveloper 10.1.2.The cause
This happens when using JSTL 1.0 in JSP 2.0When the Deployment Descriptor (web.xml) is from version 2.4 - you see it in your web.xml file:
then the default mode for JSP pages is to evaluate EL expressions, what raises the above errors when JSTL 1.0 libraries are used.<web-app (...) version="2.4" (...) >
The solution(s)
Depending on the fact you want to continue working with the JSTL 1.0 libraries or not, here are different solutions you can implement:- use the JSTL 1.1 libraries;
you should add the 1.1 libraries to your Project and replace the URIs in your pages, as they are different between the 2 versions.
The new URIs are similar to the old JSTL 1.0 EL URIs, except that jsp/ has been added in front of jstl, stressing JSTL's dependency on the JSP specification (which now "owns" the EL).
For example:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - use the "Request-Time" (..._rt) JSTL 1.0 libraries:
for example, if you use the core library, replace "core" by "core_rt"
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> - Create your JSP Pages in a Project with a 2.3 Deployment Descriptor
Each JSP page has a default mode for EL expression evaluation. The default value varies depending on the version of the web application deployment descriptor.
The default mode for JSP pages delivered with a Servlet 2.4 descriptor is to evaluate EL expressions.
The default mode for JSP pages delivered using a Servlet 2.3 or earlier descriptor is to ignore EL expressions.
So, if you create your JSP pages with JSTL 1.0 in a "Servlet 2.3/JSP 1.2 (J2EE 1.3)" Web Project (when you create a "Web Project" in JDeveloper 10.1.3, you are prompted for its version), the EL will be ignored and your page will compile.
- Deactivate the EL evaluation with a Page directive or in the Deployment Descriptor:
You can deactivate the EL evaluation either at the JSP page level, in the page directive, by setting the isELIgnored attribute to "true":
<%@ page (...) isELIgnored="true" %>
or in your Deployment Descriptor (web.xml), by setting the <el-ignored></el-ignored> element to true (subelement of <jsp-property-group></jsp-property-group>):
(...)
<jsp-config>
<jsp-property-group>
<display-name>Ignore EL</display-name>
<url-pattern>*.jsp</url-pattern>
<el-ignored>true</el-ignored>
</jsp-property-group>
</jsp-config>
(...)
(*) MetaLink requires a login that you get with your Oracle Support licence.
References
- JavaServer Pages Specification Version 2.0
Document can be download from http://jcp.org/aboutJava/communityprocess/final/jsr152/ - JavaServer Pages Standard Tag Library Version 1.1
Document can be download from http://jcp.org/aboutJava/communityprocess/final/jsr052/