Forums Register Login

getProperty and useBean

+Pie Number of slices to send: Send
Assume Dog has a property breed, can we get the property by this:
<%
Dog dog=new Dog();
dog.setBreed("spaniel");
session.setAttribute("d",dog);

%>
<jsp:getProperty name="d" property="breed"/>

In other words, without going through <jsp:useBean>.

In tomcat, this does print out "spaniel". However, in JSP spec 5.3


consequence of the previous paragraph is that objects that are stored
in, say, the session by a front component are not automatically
visible to jsp:getProperty actions in that page unless a jsp:useBean, or
some other action, makes them visible.



Can anyone explain the rule relating useBean and getProperty.

Thx
Won't you be my neighbor? - Fred Rogers. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 665 times.
Similar Threads
<jsp:useBean>
jsp:useBean doubt
[Solved]Need some clarification about <jsp:useBean/> standard action.
jsp:useBean doubt
Using [jsp:getProperty] without useBean?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:13:26.