Jay,
I may be coming at this from the wrong angle since I don't use beans, but
couldn't you have a "controller" bean that you pass parameters to and then
that
bean would call the correct table beans?
For example:
User requests table 1 and table 3
Request calls tablecontroller and passes the variable string 1,3
tablecontroller parses the string into an array
tablecontroller loops through the array with something like
if array[i] == 1
call table 1 bean
if array[i] == 2
call table 2 bean
etc.
Then concatenate the results and pass them to the JSP
Margaret
-----Original Message-----
From: Jay Burgess [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 9:36 AM
To: [EMAIL PROTECTED]
Subject: Re: Model 2 questions
Unfortunately, if I understand your suggestion correctly, then I've got to
load every single table in my database as a bean, in case a given JSP might
need one or more of them. Since this could theoretically be terabytes of
data, I don't believe that solution would work.
I think I've convinced myself that since the only way I can know which
tables a given JSP needs is to read the JSP in the controller, so I'm going
to have to go that route.
(If someone can show me another way, or show me a flaw in my thinking,
that'd be great too.)
Jay
> -----Original Message-----
> From: David Mossakowski [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 2:30 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Model 2 questions
>
>
> Your first question has been answered nicely already.
>
> As for the second I would suggest for you to have a
> TableListBean where
> you would put two TableBean instances one representing Table 1 and the
> other representing Table 2. Then in JSP you will use the TableBean
> representing Table 1 twice and the other once.
>
> The TableList might be implemented by using names to store
> TableBean or
> indexes.
>
> d.
>
> Jay Burgess wrote:
>
> > (I got no replies on the JSP list to these questions, so I
> thought I'd try
> > here...)
> >
> > 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 Table 1 as a
> chart", "show Table 1
> > as a table", and "show Table 2 as a table"), then I'd like
> to load Table 1
> > data into one bean, Table 2 data into a second 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 determine which
> > table(s) it needs to create beans for from the database?
> >
> > Jay
> >
> >
> ______________________________________________________________
> _____________
> > To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives:
http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
>
--
David Mossakowski [EMAIL PROTECTED]
Instinet Corporation 212.310.7275
****************************************************************************
***
<<Disclaimer>>
This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and/or
CONFIDENTIAL or both.
This email is intended only for the personal and confidential use
of the recipient(s) named above.
If the reader of this email is not an intended recipient, you have
received this email in error and any review, dissemination,
distribution or copying is strictly prohibited.
If you have received this email in error, please notify the sender
immediately by return mail and permanently deleting the copy
you received.
Thank you.
****************************************************************************
***
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html