Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL is not enable by default in Tomcat 5.0

 
Vince Hon
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Sanjay pts
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are right as i had gone thru same problem.
[ May 25, 2005: Message edited by: Sanjay pts ]
 
Wei-ju Wu
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, on Tomcat 5.5.7 + JDK 1.5



gives me

JSP-Test: 42

 
Vince Hon
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic