File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes getProperty and useBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getProperty and useBean" Watch "getProperty and useBean" New topic

getProperty and 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();

<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.

wood burning stoves
subject: getProperty and useBean