I am trying to determine what the benefits are to using beans over just
an ordinary class.  From the little that I know, I don't see the
benefit.

Take the calendar example for a bean (here is the JSP code) :

<html>
<jsp:useBean id="clock" class="calendar.jspCalendar"/>
<ul>
<li>Day:<%= clock.getDayOfMonth() %>
<li>Year:<%= clock.getYear() %>
</ul>
</html>

Versus just an ordinary server-side java class (here is the JSP code):

<html>
<% JspCalendar clock = new JspCalendar() %>
<ul>
<li>Day:<%= clock.getDayOfMonth() %>
<li>Year:<%= clock.getYear() %>
</ul>
</html>

Can someone give me an idea of why I should use beans over a regular
server-side class?

Thanks,
Patrick Regan

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

Reply via email to