File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL not recognized! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL not recognized!" Watch "EL not recognized!" New topic
Author

EL not recognized!

pallavi utukuri
Ranch Hand

Joined: Feb 10, 2004
Posts: 182
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


Thanks,<br />Pallavi
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
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

Joined: Feb 10, 2004
Posts: 182
will installing Tomcat5 alone work for EL and JSTL or do i need to install something else
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
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

Joined: Feb 10, 2004
Posts: 182
EL is working that gives a lot of relief cause my brother is an atrist ......trying JSTL now....
alzamabar
Ranch Hand

Joined: Jul 24, 2002
Posts: 379
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?


Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
alzamabar
Ranch Hand

Joined: Jul 24, 2002
Posts: 379
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

Joined: Aug 31, 2004
Posts: 118
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 ]

Cheers,<br />Roger<br />SCJP 1.2, 1.4, SCBCD 1.3, SCWCD 1.4
alzamabar
Ranch Hand

Joined: Jul 24, 2002
Posts: 379
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
 
 
subject: EL not recognized!