First, see my previous reply to Margaret about what the user is going to
request.  It's a JSP page, not a call to a servlet.

However, your second point about letting the JSP do the DB access is closer
to what I need, but it doesn't allow me (I think) to do the loads in
parallel.  I have to load Table 1, render the table, load Table 2, render
the table, then render Table 1 again as a chart. Table-1-load and
Table-2-load are serial, not parallel.

What I'd like to do is simultaneously kick-off both Table 1 and Table 2
loads in the controller servlet.  Then, when the last one finishes, forward
to the JSP with the minimum set of data beans, and let the rendering take
place.

The more I discuss this on the list, the more I'm convinced that I need to
parse the JSP.  But I'm still open to suggestions otherwise. :)

Jay

 > -----Original Message-----
 > From: David Mossakowski [mailto:[EMAIL PROTECTED]]
 > Sent: Thursday, April 25, 2002 3:09 PM
 > To: [EMAIL PROTECTED]
 > Subject: Re: Model 2 questions
 >
 >
 > No, you don't have to.  When you make a request to display a table do
 > you not send as parameters which table to display, to the
 > servlet?  Like
 > GET /servlet/GetTables?table1=yes&table2=yes
 >
 > You obviously have to have this info somewhere.  I suspect
 > that you have
 > it in the JSP page and you think that you have to have all the data
 > ready in the bean so that it gets displayed.  This is not true.  The
 > TableList bean can get the data on its own when asked for it.
 >  So in my
 > example the call to get a table from TableListBean would
 > actually go out
 > to the database to get that data.  Next time the same table is called
 > for it would use the data that it already got for this request.
 >
 > The flow would go like this
 > GET /displayTables.jsp
 >
 > useBean TableListBean
 >
 > JSP wants to display Table 1 as an HTML table
 >
 > JSP calls TableListBean.getTable(1);
 >
 > TableListBean connects to DB and gets the data and returns it to JSP
 >
 > JSP renders the chart as HTML table
 >
 > JSP wants to display Table 2 as HTML table
 >
 > JSP calls TableListBean.getTable(2);
 >
 > TableListBean connects to DB and gets the data for Table 2
 >
 > JSP renders Table 2 as HTML
 >
 > JSP wants to render Table 1 as JPG
 >
 > JSP calls TableListBean.getTable(1)
 >
 > TableListBean doesn't connect to DB because it already has this table
 >
 > JSP renders this table as JPG
 >
 > d.
 >
 > Jay Burgess wrote:
 >
 > > 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

Reply via email to