aspose file tools*
The moose likes JSP and the fly likes jstl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jstl "expression language ( "${...}" ) in static text" Watch "jstl "expression language ( "${...}" ) in static text" New topic
Author

jstl "expression language ( "${...}" ) in static text

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Hi,

I'm a newbie user of jstl "expression language" .
I've got it to work *within tags*, but not in static text.
E.g:
Here's how i use it in a tag: <c ut value="${2+2}" >.
This works fine and prints out "4".

But here's how I use it in static text:
<html> This is some static text ${2+2} </html>
This does not evaluate to "4"... instead, it literally prints out ${2+2}.

I'm using tomcat 5 with jakarta's implementation for jstl.
I've even added the following to my web.xml :
< el-enabled>true < / el-enabled >
It did not help.
Am I doing it wrong ? I've double-checked with various web tutorials, and they all state that EL *should* work with static text...

Thanks !
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61601
    
  67

Two things:

1) Be sure that your web app is declared as a Servlet 2.4 web app in the web.xml

2) Be sure that you are using a JSTL 1.1 implementation


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Thanks a million, your quick reply has been a real life saver ))


For anyone reading this, if you need to configure tomcat for 2.4 spec, here's a link I found useful:

http://indrayam.com/archives/application_development/000243.php
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jstl "expression language ( "${...}" ) in static text