"I'm wondering what's the use of beans with JSP. In my (humble) opinion,
beans are useless... everything I can do with beans can be done with
"normal" java objects as well."
But you're a java programmer....think about it from the HTML coder's
perspective.
"<jsp:useBean id="myBean" class="MyBean" scope="session">
can easily be replaced by
<% MyBean myBean = new MyBean();
session.put("myBean", myBean); %>"
See above.
"- Construction of beans seems to be limitied to using the
(argument-less) standard constructor. Constructors with arguments are
not supported.
- Using <jsp:setProperty>, only String properties can be set. If I want
to set any other properties, I have to access the bean directly anyway."
Properties can be set from the request as well...something you can't easily
do with a 'normal' class. And properties other than strings can be set, see
the spec for details on what will and wont be auto converted.
--
dIon Gillard, Multitask Consulting
Work: http://www.multitask.com.au
Play: http://www.trongus.com
I've just returned from THE Java Programming Conference,
http://www.SoftwareSummit.com - be there next year
----- Forwarded by dIon Gillard/Multitask Consulting/AU on 06/12/99 11:35
-----
So, I'd really like to know what's the big deal about beans? I would
rather write my JSP pages without using beans, but I'm wondering if I'm
missing something? What's the reason that beans were introduced to JSP
in the first place? Are there any situations in which the use of beans
provides a real advantage over the "traditional" approach?
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html