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/
Comments (6)
I have to admit, this is more complicated then you make it out to be. A few of the fixes address getting it running in 10.1.3, but ignores backward compatibility. For example, while changing to the RT versions of the taglib will enable it to work under 10.1.3, the webapp won't work in 10.1.2 anymore. If you include the bit, the JSP won't even compile under 10.1.2. The jsp-config block means that the whole web-app won't even work under 10.1.2.
So yeah, great if we want to move to J2EE 1.4, but balls up the ass if we want to use JDev 10.1.3 to work on a J2EE 1.3 app.
Pretty frustrating. I wish I could stick with MyEclipse.
Posted by Michael Laccetti | January 18, 2007 5:38 PM
Posted on January 18, 2007 17:38
Hi Michael,
most of the customers who contacted me so far wanted to migrate forward. This post was written with this in mind.
And those who wanted to continue working with JSTL 1.1 did in a J2EE 1.3 Web Project.
Regards,
Didier.
Posted by Didier Laurent | January 19, 2007 1:10 AM
Posted on January 19, 2007 01:10
Thanks a lot! This was very useful for my situation!
Posted by Megas | May 15, 2007 6:17 AM
Posted on May 15, 2007 06:17
Thanks - I'm happy it helped.
Posted by Didier Laurent | May 15, 2007 6:31 AM
Posted on May 15, 2007 06:31
I am using JSTL 1.0 in a Servlet 2.3/JSP 1.2 web application. Using jdeveloper and embedded server, I've often got the Expression Language not supported in compile time attribute value error, but resolved it by a rebuild and server restart. (or once it was when the datesatmps on the jsp files seemed to have got in a mess).
However now i dont seem to be able to get past this problem. Do you have any advice ?
Thanks
Posted by moo | June 23, 2009 11:56 AM
Posted on June 23, 2009 11:56
Lots of time has passed but this post is still valid - helped me to resolve a similar issue. Thanks!
Posted by Tuukka Mustonen | September 29, 2009 1:39 PM
Posted on September 29, 2009 13:39