Not sure about what others do, but what I've done is create an
InitServlet that loads all drop down lists that are not likely to change
(i.e. state list).  I then store these in the application layer.

To retrieve, I've created a custom tag which displays the list as a
state drop down.

Hope this helps,

Kevin Williams

On Thu, 2003-03-13 at 17:17, White, Joshua A (CASD, IT) wrote:
> Hello All,
> 
> I thought I would be slick an attempt to cache the Collections used to
> populate my forms drop down list boxes instead of hitting the database every
> time (The values may change daily).
> 
> The problem is that the inherited "servlet" variable and the "getServlet"
> method only return a reference to the ActionServlet when calling the "reset"
> and "validate" methods.  (The same holds true for the action classes.  A
> valid ActionServlet instance is only returned when performing the action).
> All other times, these references are null.  Is there another way of getting
> a ServletContext reference in the ActionForm class?
> 
> Could anyone suggest some strategies for caching the collections used for
> generating drop down list boxes?  
> 
> Regards,
> 
> Joshua
> 
> 
> 
> This is what I found...
> ------------------------------------------------
> Creating TestForm.....
> servlet member variable is NULL
> getServlet() is NULL
> >>>CALLING RESET!!
> servlet member variable is OK
> getServlet() is OK
> >>>CALLING VALIDATE!!
> servlet member variable is OK
> getServlet() is OK
> Creating TestAction
> servlet member variable is NULL
> getServlet() is NULL
> Performing TestAction...
> servlet member variable is OK
> getServlet() is OK
> 
> 
> This communication, including attachments, is for the exclusive use of 
> addressee and may contain proprietary, confidential or privileged 
> information. If you are not the intended recipient, any use, copying, 
> disclosure, dissemination or distribution is strictly prohibited. If 
> you are not the intended recipient, please notify the sender 
> immediately by return email and delete this communication and destroy all copies.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to