• 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 is not enable by default in Tomcat 5.0

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you are right as i had gone thru same problem.
[ May 25, 2005: Message edited by: Sanjay pts ]
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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">

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic