GeeCON Prague 2014*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Problem with HFSJ EL exercise pg 366 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 "Problem with HFSJ EL exercise pg 366" Watch "Problem with HFSJ EL exercise pg 366" New topic
Author

Problem with HFSJ EL exercise pg 366

Mukunthan Shanmuganathan
Ranch Hand

Joined: Jul 24, 2007
Posts: 32
Hi Guys!

In order to check the EL pg. 366 I wrote the JSP (result.jsp) as follows,

<%@ page import="com.example.*" %>

<html>
<body>
<jsp:useBean id="person" class="com.example.Person" scope="request" />

The person's name is: <jsp:getProperty name="person" property="name" />
<br>
The person's dog's name is: ${person.dog.name}

</body>
</html>


When I deploy and run I get

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

Why is that?

:roll:


Dare to know!
Tarun Yadav
Ranch Hand

Joined: Sep 20, 2007
Posts: 134
This indicates that EL is disabled.

It could either have been disabled by you, using the isELIgnored page directive attribute or the <el-ignored> element in the DD ( web.xml ).

The more probable cause is that you're using the DTD for specification 2.3 and not 2.4. With the Servlet specification 2.3, EL is disabled by default.

Also, keep in mind that with the JSTL 1.0, you could use the EL as part of the tags, like <c ut> ( using the RT version of the library ) but not anywhere else in the page. JSTL 1.1 is meant for the JSP specification 2.0.
Mukunthan Shanmuganathan
Ranch Hand

Joined: Jul 24, 2007
Posts: 32
Dear Tarun Yadav ,

Thank you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem with HFSJ EL exercise pg 366