Sorry to bother you, but I'm a having few problems with JSP and Beans:

1) I would like to populate an array stored on the client with data from a bean.
Is there any way call a getXXX() method within a JavaScript function, or do I
have to pass the result of the getXXX() method as a parameter to the JavaScript
function? Also, is there any way of getting at session variables within
JavaScript?

2) Bean / servlet design: what are the advantages and disadvantages of servlets
and beans calling backend logic (i.e. database/ RMI client). These are the two
scenarios:

A: The servlet contacts the backend logic, passes the result to the bean via its
setXXX() method and then passes control to the JSP.

B: The bean contains an 'initData()' method which is called by the servlet. This
method instructs the bean to contact the backend logic and use the result to set
its own properties. The servlet then passes control to the JSP. Here the servlet
is acting solely as a controller.

 I like B, because it keeps the servlet as thin as possible, putting less strain
on the web service. But is it good design to let the bean set its own
properties?

Also, do beans run in the same JVM as the servlets?

Any thoughts on the above would be most helpful.

Many thanks,

Patrick O'Keeffe

Tertio Limited  -  One Angel Square,   Torrens Street,   London  EC1V 1NY
Tel: +44 (0)171 843 4000 Fax: +44 (0)171 843 4001 Web http://www.tertio.com
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Tertio Ltd.

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