This would work but if the lists are the same for all users, then it would
be more efficient to store them in the servlet context. I worked on a
application that had many lists of this nature, and I built a simple
LookupManager class which encapsulated a Hashtable of Vectors, keyed by a
string. In my base servlet class (from which all my application servlets
were derived), I instantiated the LookupManager in the init() method, and
stored it in the servlet context. Then, whenever I needed to populate a list
on a JSP, I could simply retrieve the LookupManager from the servlet context
and retrieve the desired list.
Paul
-Original Message-
From: SUPRIYA MISRA [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 21, 2001 10:22 AM
To: [EMAIL PROTECTED]
Subject: Re: requery db for select lists?
If you know in advance that this page needs Database access and the data in
the database will not change between sessions, the best thing is to make a
database access and store the data as a session variable.
From: Andy Noble [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts User List [EMAIL PROTECTED]
Subject: requery db for select lists?
Date: Wed, 21 Nov 2001 14:28:09 -
Hi,
When a JSP is posted in struts, the entered values get copied to an
ActionForm object so that the JSP can be redisplayed if necessary and the
data survives across the request.
Is this also true for the data in a select list?
On initial creation of the JSP, I will be accessing the database for data
to
populate a select list. But do I have to requery the database if the JSP
needs to be redisplayed?
Thanks in advance.
Andy
--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]