Get your CodeRanch badge!*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL is not enable by default in Tomcat 5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL is not enable by default in Tomcat 5.0" Watch "EL is not enable by default in Tomcat 5.0" New topic
Author

EL is not enable by default in Tomcat 5.0

Vince Hon
Ranch Hand

Joined: Feb 11, 2003
Posts: 117
From HFB p.320,it said:

EL is enabled by default


However, in my jsp:
<html>
${2+2}
</html>

When I run this, the result is ${2+2} (no "4" as I expected).

Following are my testing results using Tomcat 5.0:



Therefore, I wonder this statement "EL is enabled by default" correct ? Or, is the default EL behavour container-specific ?


Vince Hon<br /> <br />SCJP 1.4 | SCWCD | SCBCD <br /><a href="http://vincehon.homeip.net:8000/VJW" target="_blank" rel="nofollow">http://vincehon.homeip.net:8000/VJW</a>
Sanjay pts
Ranch Hand

Joined: Nov 07, 2000
Posts: 357
you are right as i had gone thru same problem.
[ May 25, 2005: Message edited by: Sanjay pts ]

Eat JAVA, Drink JAVA, Sleep Java
Wei-ju Wu
Ranch Hand

Joined: Feb 16, 2005
Posts: 147
Hi, on Tomcat 5.5.7 + JDK 1.5



gives me

JSP-Test: 42



"The UrlyBird catches the certificate. And he's gonna FlyByNight"<br /> <br />SCJP 1.2/5.0, SCJD, SCBCD, SCWCD, SCEA
Vince Hon
Ranch Hand

Joined: Feb 11, 2003
Posts: 117
haha, thanks.

Actually, I'm using the serlvet and jsp in production environment. I don't have chance to use such new technology like Tomcat 5.5 and J2SE1.5.
Vince Hon
Ranch Hand

Joined: Feb 11, 2003
Posts: 117
Finally, I got the reason:

I have to put <%@ page isELIgnored="false" %> in jsp to make EL work when My web.xml is this:

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">


When I update my web.xml to 1.4, EL is enable by default, i.e. I don't have to put <%@ page isELIgnored="false" %> in jsp.


<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">
John Wolf
Ranch Hand

Joined: Feb 18, 2002
Posts: 64
Vince,

I went through a similiar issue and I had to change the following in my Deployment Descriptor (web.xml):-



EL is enabled by default in J2EE 1.4 - Tomcat 5.x as per the HF, but you must declare that you are using Servlet 2.4 and JSP 2.0 by using the above web-app in the deployment descriptor.


SCJP 1.2, SCJP 1.4, SCJA, SCWCD 1.4<br /> <br />------------------------------<br />
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: EL is not enable by default in Tomcat 5.0
 
Similar Threads
EL Confused
Need help with Tomcat 5 and el
EL Hell
isELIgnored="false"
EL question