• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with HFSJ EL exercise pg 366

 
Mukunthan Shanmuganathan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Tarun Yadav
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Tarun Yadav ,

Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic