Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

No EL support in JSTL tags?

843836Feb 11 2004 — edited Nov 28 2007
I plan to use both JSTL and JSP 2.0 EL in my JSPs. I tried to use an if-tag, with an expression in the test attribute like this:
<c:if test="${!empty sessionScope.userdata}"><h2><mywaf:include name="userinfo"/></h2></c:if>

The JSTL specs show examples like this, i.e. using JSTL and EL together, which is a natural thing as JSTL actually introduced EL. So why does Tomcat give me an error when I access the page:

org.apache.jasper.JasperException: /jsp/en_EN/template.jsp(14,0) According to TLD or attribute directive in tag file, attribute test does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:186)
...

I looked into the JSTL core tag tld, and indeed, for every single attribute they specify
<rtexprvalue>false</rtexprvalue>

indicating that this is a "runtime attribute".

So what am I doing wrong here?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2007
Added on Feb 11 2004
12 comments
610 views