I think the purpose is because the JavaBean spec requires the use of private
fields with public getter/setter methods, AND that it implements
Serializable. The important thing to remember is that if you want a scalable
front-end setup, the application servers do session level fail-over ONLY if
all objects in the HttpSession implement Serializable properly..otherwise it
can NOT serialize session objects to multiple servers and thus breaks the
ability for session level fail over.
Classes on the other hand are not required to do anything..therefore using a
class that is not a javabean (according to the spec only..javabeans are
classes indeed), then its probable that HttpSession level fail-over will not
work at all if you have an environment like that. However, you certainly can
use simple classes without the right getter/setter methods and private
access fields (properties) with implmentation of Serializable. It works
fine. Its just not recommended in the case you move to a scalable solution
in the future.
> -----Original Message-----
> From: Shawn Zhu [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 18, 2001 2:24 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Why use Java beans ?
>
>
> This question seem to come up over and over in this
> list...JavaBeans are classes!
>
> > -----Original Message-----
> > From: Singh, Jasbinder [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 18, 2001 2:04 PM
> > To: [EMAIL PROTECTED]
> > Subject: Why use Java beans ?
> >
> >
> > Hi,
> >
> > Could someone please explain the following to me:
> >
> > What is the advantage of using JavaBeans with servlets and
> > JSPs when the
> > same
> > result could be obtained by common classes ?
> >
> > This might be a basic question, but any elaboration would be greatly
> > appreciated.
> >
> > Thanks
> > JS
> >
> > ==============================================================
> > =============
> > 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://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
> ==============================================================
> =============
> 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://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
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://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets