Mike,
Currently a bean can comprise multiple classes. Classes can be member
variables just like any native type. Beans also can have inner classes. In
order to access a class within a bean, I would think that it would be just
as easy if not easier to access from the instance variable directly than
with the getProperty tag.  I also think that Larne's opinion of the JSP
spec might not be the same as that of other authors of JSP books. I have
several books on JSP including ones by Marty Hall, David Geary, and the
Wrox book, and they say that the only benefit of using the getProperty tag
is for the benefit of page designer who doesn't understand Java scriptlets.
Remember, you can define a bean using a tag such as <jsp:usebean
id="foo"....>  and later access as foo.getXXX() later on. In Hall's book,
he says that the direct access method is more convenient to use in "loops,
conditionals, and methods not represented as properties" (p. 290). The last
one is
particularly good to remember since it points out that sometimes the
getProperty method can't be used to access values returned by methods that
don't have corresponding member variables.

Regards,

Richard



At 10:18 AM 4/29/2002 -0600, you wrote:
>Thanks Richard,
>
>It took me a while to find it:
>
>In one of the first book on JSP: JavaServer Pages by Larne Pekowsky.
>
>Page 49, he is saying:
>
><<beg of quote>>
>
>For example, this tag from the previous example:
>
><jsp:getProperty name="bean1" property="seventhPrimeNumber"/>
>
>could be rewritten as
>
><%= bean1.getSeventhPrimeNumber( ) %>
>
>The latter form is a little shorter; however the former is recommended
>because it makes it clear that the object is a bean. In addition, down the
>road the bean specification may be expanded so that a bean can comprise
>multiple classes, at which point this translation will not work any more.
>
><<end of quote>>
>
>That is what I was referring to.
>
>Cheers, Mike
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to