Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run EL code using Tomcat

 
Madhu Kumar Vatts
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing problems running anything related EL. It just prints the ${} when I ask it to print any JSP. Do I need to keep any jar in the lib of my application. Forgot to mention I am using TOMCAT.

Appreciate your reply

Madhu
 
Sami Sayeed
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

make sure it is tomcat version 5,
you dont have to anything specific to make the el work, by default it should work,

only for the jstl you need to copy the jstl.jar and the standard.jar files in the WEB-iNF/lib directory of the webapp

Sami
 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't know whether you need to specify the web-app tag like this to get it working :-

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" version="2.4">
 
Sudhakar Guntaka
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi madhu,
There is no need to keep any jar files. Ensure that you are using JSP 2.0 and Tomcat 5 or above.
I too faced the same problem. So I used <%@ page isELIgnored="false"%> explicitly in my JSP page, then it worked.
Just try using like this.. u will get it..

cheers,

Sudhakar.
 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may sound funny but it's true that for Tomcat 5 to make the EL work you need not change web.xml as said above but rather use the isELIgnored="false" page attribute as mentioned by Sudhakar above. Funny because, by default the isELIgnored attribute is supposed to be "false", yet you need to specify it explicitly.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forget about isELignored and do as Giju George told you.
You have to use version 2.4, because EL is ignored by default in 2.3
 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

However, I agree that it also works with the modified web.xml, as mentioned above and "without" using isELIgnored page attribute.
[ December 14, 2005: Message edited by: Debashish Chakrabarty ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using 2.3, so EL is disabled by default. As you said, you have to set isELIgnored to false to make it work.

If you'd be using 2.4, EL would be enabled by default.

"Madhu Kumar Vatts" is probably studying for the latest version of SCWCD,
so it is probably a better idea to use 2.4, and modify web.xml.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic