• 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

How to use Expression Language(EL)?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Raanchers,

I am not able to run expression language in my JSP.
The Tomcat Version I am using is 5.0.28(I think tomcat 5 implements JSP2.0 which have EL)


My Jsp Page is
<html>
<body>
<table><tr><td>${1+2}</td></tr></table>
</body>
</html>

When I launch it the browser(MSIE)shows
${1+2}


I tried looking into Tomcat JSP-examples jsp2 folder for EL examples but

I have found

<servlet-mapping>
<servlet-name>org.apache.jsp.jsp2.el.basic_002darithmetic_jsp</servlet-name>
<url-pattern>/jsp2/el/basic-arithmetic.jsp</url-pattern>
</servlet-mapping>



<servlet>
<servlet-name>org.apache.jsp.jsp2.el.basic_002darithmetic_jsp</servlet-name>
<servlet-class>org.apache.jsp.jsp2.el.basic_002darithmetic_jsp</servlet-class>
</servlet>

in the \jakarta-tomcat-5.0.28\webapps\jsp-examples\WEB-INF

Can anybody tell me why is this done?

Will I have to enable EL using <el-ignored>false</el-ignored>?

Please let me know if I am missing something very basic.

Thanks in advance

Regards
Sangram
[ September 08, 2006: Message edited by: Sangram Singh ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you read the JSP FAQ entries on this subject? Particularly with regards to proper web.xml set up?
 
Sangram Singh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear ,


Thanks ...My mistake
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No problem. Is it working now?
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Even I have had a similar problem. I am using Tomcat 5.0.28.

By default, EL is disabled. Unless I specify in my JSPs, they are not evaluated. I haven't set in my web.xml.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

By default, EL is disabled. Unless I specify



The EL is disabled only if you have declared your application using the Servlet 2.3 doctype. If you correctly declare your web app using the Servelts 2.4 schema, the EL is enabled by default.
 
Sangram Singh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear,


Yes its working now.You know I was working on this issues for last 2 days...

Just changed my <web-app> tag with following attribute

<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 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">


And its working now..Thanks again
[ September 10, 2006: Message edited by: Sangram Singh ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic