Hi Heiko,
Are you saying that beans should not be used or that tags like
<jsp:useBean ..... > and <jsp:setProperty .... > should not be apart of
the JSP spec?
Actually, These tags follow the same semantics as laid out by the 'tag
extension' mechanism in JSP 1.1 . So really they are just a required
standard set of custom tags for the benefit of web page designers.
If this is not exactly true than, imho, it should be.
Spencer Ridder
Heiko Gottschling wrote:
>
> Hi,
>
> 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.
>
> For example,
>
> <jsp:useBean id="myBean" class="MyBean" scope="session">
>
> can easily be replaced by
>
> <% MyBean myBean = new MyBean();
> session.put("myBean", myBean); %>
>
> Moreover, beans obviously have some disadvantages:
>
> - the syntax is very awkward. Instead of writing <jsp:setProperty
> name="myBean" property="prop" value="val"> I can write
> myBean.setProp("val"), which seems much smoother
> - 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.
>
> 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?
>
> thx
> Heiko
>
> ===========================================================================
> 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
===========================================================================
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