Forums Register Login

Doubt in Expression Language

+Pie Number of slices to send: Send
I have doubt in JSP Expression Language. I tried example given on page 365 and 366 in HFSJ.

<%@ page import="foo.*"%>

<html>
<body>
<%--Normal java script code---1
<%= ((foo.Person) request.getAttribute("person")).getDog().getName()%>--%>

<%-- without java scripting -------2
<jsp:useBean id="person" class="foo.Person" scope="request" />
Dog's nam e is <jsp:getProperty name="person" property="dog"/> --%>

<!-- Using Expression Language --%>---3

Dog's name is: ${person.dog.name}
</body>
</html>



1 and 2 gives the output as expected.
However when i try to get the output using 3 i.e using EL, then i DONOT see wht is expected. I expected dog's name to be printed, however it simply prints the text i.e " Dog's name is: ${person.dog.name}"

What do i need to include in my JSP to make it work....

"
+Pie Number of slices to send: Send
See the JSP FAQ for properly setting up your web application.
+Pie Number of slices to send: Send
thanks...
+Pie Number of slices to send: Send
Looks like EL evaluation is ignored, make sure its not disabled in your web.xml and you can override the web.xml setting in the JSP using
<%@page isELIgnored="false" %>
+Pie Number of slices to send: Send
 

Originally posted by Deepak Jain:
you can override the web.xml setting in the JSP using <%@page isELIgnored="false" %>

A properly set up web.xml makes this unnecessary.
+Pie Number of slices to send: Send
Thanks deepak for the extra info......
Thanks Bibeault for clarification....
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 759 times.
Similar Threads
EL ignored
Doubt regarding useBean and getAttribute
EL issue in HFSJ
Problem with HFSJ EL exercise pg 366
EL doubt
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:12:55.