This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EL expressions are not being evaluated  RSS feed

 
tim smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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 ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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:
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
i did, now can someone help answer my question.
 
Stefan Evans
Bartender
Posts: 1834
10
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!