Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem Using Expresssion Language code in Tomcat

 
sai Narayan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have add.jsp which has the following code:-

<%@ page contentType="text/html" %>

<HTML>
<BODY>
1+2+3 = ${1+2+3}
</BODY>
</HTML>


when i run the jsp in Tomcat 5.0 the Expression Language is not evaluated and i get the output as:-

1+2+3 = ${1+2+3}

Please help!
Thanks.
 
Pedro Penna
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, check your Tomcat version. If I'm not mistaken, JSP 1.2 and Servlet 2.4 works only in tomcat version 5.x

Next, check your web.xml file. It should declare your application uses the specifications mentioned above.
This is how the tag should look like:
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP 1.2 and Servlet 2.4 works only in tomcat version 5.x


I'm sure Pedro meant JSP 2.0.

And yes, he is corect. For tomcat to 'switch on' JSP 2.0 EL processing, the web app must be declared as a Servlet 2.4 web application as he indicated.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!