O'Keeffe Patrick wrote:
>
> Hi,
>
> I'm an ASP developer who is trying to put forward a case for using the
> JSP/Servlet/JavaBean approach. I'd be very grateful if someone could explain the
> following to me:
>
> What is the advantage of using JavaBeans with servlets and JSPs when the same
> result could be obtained by chaining servlets and JSPs? Both approaches separate
> content from presentation. Granted, the latter places more strain on the web
> service, but is there some other argument for involving JavaBeans?
>
> This might be a basic question, but any elaboration would be greatly
> appreciated.

I'm not sure what you mean with "chaining servlets and JSP" (see the archives
for great discussions about what "chaining" usually means in relation to
servlets).

JavaBeans are great as containers of information. Your servlet can do all the
business logic and save the result in a JavaBean or two and then forward to
a JSP page for presentation. In the JSP page you can use <jsp:getProperty>
to display the result (in in JSP 1.1, custom tags to do even more, such as
iterate over a multi-value JavaBean).

Someone else asked about the difference between a JavaBean and a regular
class for carrying information this way. The difference is really just that
the JavaBean naming convention makes it possible to use "tools"  (in its broadest
sense) with JavaBeans, e.g. the JSP standard actions/tags today and GUI web
development tools in the future (hopefully).

--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

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