jQuery in Action, 2nd edition*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Using [jsp:getProperty] without useBean? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Using [jsp:getProperty] without useBean?" Watch "Using [jsp:getProperty] without useBean?" New topic
Author

Using [jsp:getProperty] without useBean?

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
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
 
Don't get me started about those stupid light bulbs.
 
subject: Using [jsp:getProperty] without useBean?