• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EL expressions are not being evaluated

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

For some reason, my EL expressions do not evaluate, they are being printed out as literals.

for example:
<%
pageContext.setAttribute("x",new Integer(5));
%>
The value of x is ${ x }

the output i get is: The value of x is ${ x }
instead of: The value of x is 5

my setup is tomcat 5.0 which supports EL.
what can cause this? is it something with my setup, the deployment descriptor?

thanks for the help.
[ July 14, 2005: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you bring a web.xml file from a previous version of Tomcat?
You need to specify version="2.4"

Example:
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"recentgrad somewhere",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
tim smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i did specify version 2.4 in the <web-app>

for some reason it seems like EL is turned off, but it should be on by default.

what can i do to make my EL expressions evaluate properly?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"recentgrad",

My request for you to adjust your display name to JavaRanch standards was not a suggestion. Please adjust your display name accordingly prior to your next post.

Accounts with invalid display names are closed.

bear
Forum bartender
 
tim smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i did, now can someone help answer my question.
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try putting this on your page and see if it fixes it:
<%@ page isELIgnored="false" %>


Rules for when EL evaluation is disabled refer to the JSP2.0 specification section 3.3.2.
Summary - in order of precedence:
- page directive for EL <%@ page isELIgnored="true|false" %>
- an entry in web.xml like this


- the version of your web.xml file. If it declares itself as version 2.3 EL is disabled (unless overridden specifically on the page)

Try the override on the page, and see if that fixes it.
Double check your web.xml declaration.

Cheers,
evnafets
 
tim smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the insight people. I got it to work now, I made a new web.xml file and that did the trick, the other one i was using was causing the problem.
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic