Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why JSTL core tag doesn't support EL?

 
Ren Shao
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using JSTL core taglib, I use the standard URI http://java.sun.com/jstl/core, and have my c.tld in /WEB-INF/lib, with Tomcat 5.5.9.

It keeps complaining about "attribute value does not accept any expressions", however, when I changed the uri to core_rt, it all works.

I read the JSTL documentation, core_rt is for scripting, like <%= session.getAttriute("aa") %>, and core is supposed to support EL like ${}, but why it's the other way around?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using JSTL core taglib, I use the standard URI http://java.sun.com/jstl/core, and have my c.tld in /WEB-INF/lib, with Tomcat 5.5.9.


You're using the wrong version of the JSTL.

The URI you listed is a JSTL 1.0 URI. Yet you are using Tomcat 5 which is a JSP 2.0 container. Therefore, you should be using a JSTL 1.1 implementation.
 
Ren Shao
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded JSTL 1.1.2 from Apache, which I believe is the latest version and I still got this problem,

I can evaluate EL using core_rt, but not core. while according to the official documentation, I should use core for EL but not core_rt, can anyone help?
[ July 15, 2005: Message edited by: Ren Shao ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ren Shao:
I downloaded JSTL 1.1.2 downloade from Apache, which I believe is the latest version and I still got this program,

I can evaluate EL using core_rt, but not core. while according to the official documentation, I should use core for EL but not core_rt, can anyone help?


If you've left the c.tld in your WEB-INF folder and it's from the 1.0 version, it could be referencing that instead of the TLD in the JAR file. You don't need the actual tld file anymore, so check that. Otherwise, I am not sure. Maybe your expression isn't right?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the standard URI http://java.sun.com/jstl/core


Again, this is the wrong URI.

The correct JSTL 1.1 URI is http://java.sun.com/jsp/jstl/core

If you don't have a copy of the JSTL 1.1 Specification open on your desk, you're doing it wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic