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

EL not recognized!

 
pallavi utukuri
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
created form.html in
D:\Tomcat4.1\webapps\attrib
<html>
<body>
<form action ="result.jsp">
Name: <input type="text" name="name">
<input type="submit">
</form>

result.jsp in
D:\Tomcat4.1\webapps\attrib
<html>
<body>
<p>
${param.name}
</body>
</html>

http://localhost:8080/attrib/form.html
prints
${param.name}


whats wrong here
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pallavi,

EL belongs to the JSP 2.0 specs, which requires Tomcat 5 (J2EE 1.4), not Tomcat 4 (J2EE 1.3).

Regards,

Phil.
 
pallavi utukuri
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will installing Tomcat5 alone work for EL and JSTL or do i need to install something else
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pallavi,

Nothing else. You simply work with Tomcat 5 instead of Tomcat 4. If my memory doesn't betray me, you still need to install JSTL separately though, but not to get EL to work (it's built in JSP 2.0), just JSTL.

Someone else will clarify this here soon, hopefully...

Regards,

Phil.
 
pallavi utukuri
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EL is working that gives a lot of relief cause my brother is an atrist ......trying JSTL now....
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry guys, I deployed my application on Tomcat5, but still EL is not recognized:


My Servlet (only the doGet method):




My JSP page:



The output:



The person's dog name is: ${person.dog.dogName}


My web.xml:



Is there any particular setup to enable EL?
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved. Actually, because I'm using web.xml with Servlet 2.3 ('cause of XDoclet' :roll: ) the default is that EL for JSP pages is NOT evaluated by default. For web.xml for Servlet 2.4 the default is that it IS evaluated by default.

From JSP Specs 3.3.2:


The default mode for JSP pages in a Web Application delivered using a
web.xml using the Servlet 2.3 or earlier format is to ignore EL expressions; this
provides for backward compatibility.
The default mode for JSP pages in a Web Application delivered using a
web.xml using the Servlet 2.4 format is to evaluate EL expressions; this
automatically provides the default that most applications want.



I added the page directive with isELIgnored="false" in the JSP page and it worked fine.
 
Roger Yates
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have more than one .jsp page with v2.3 specified, you could add this to your DD:

[ October 24, 2004: Message edited by: Roger Yates ]
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm building with XDoclet, which hasn't got yet support for Servlet 2.4 and JSP 2.0, therefore I couldn't include the jsp-config element in the DD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic