• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use Expression Language(EL)?  RSS feed

 
Sangram Singh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66153
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hi Bear ,


Thanks ...My mistake
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66153
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem. Is it working now?
 
Tushar Madhukar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Posts: 66153
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!