In the Model 2 architecture:

(1) Is there a difference between having the controller servlet store the
"model" beans in the Request or the Session before forwarding to the JSP?
Is one better than the other, or preferred from some reason?

(2) How am I supposed to handle the case where the bean(s) that the
controller servlet is supposed to instantiate are determined by the tags
that are present in the requested JSP? Does the servlet have to open and
parse the JSP somehow in this case? As an example:

Assume I have 2 custom tags, one that displays the data from a database
table as an HTML table, and one that creates a .JPG chart image of table
data.

If Page1.jsp contains three tags ("show chart Table 1", "show table Table
1" , and "show table Table 5"), then I'd like to load Table 1 data into one
bean, Table 5 data into a separate bean, and then forward to the JSP and
let the custom tags do their drawing and charting with the two beans. This
is most efficient, as I'm only requesting data for Table 1 once, even
though it's being used twice in the JSP.

But in this scenario, how can my controller servlet know which tables it
needs to load from the database into beans?

Jay

===========================================================================
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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to