• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with HFSJ EL exercise pg 366

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Tarun Yadav ,

Thank you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic