struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Taylor" <rtay...@mulework.com>
Subject RE: static variables in actions
Date Tue, 03 Feb 2004 14:40:27 GMT
John, why not retrieve these from the DB at application start up time
and place them in the ServletContext where they are accessible for
the life time of the application and easily rendered by JSTL or Struts
tags.

robert

> -----Original Message-----
> From: Menke, John [mailto:John.Menke@acs-inc.com]
> Sent: Tuesday, February 03, 2004 9:36 AM
> To: Struts (E-mail)
> Subject: static variables in actions
>
>
> if I have a collection of state names and I don't want to have to retrieve
> it over and over again can i
> do something like this in my action?
>
>
> static Collection _collection;
>
> if (collection == null ){
>    _collection = getCollectionFromDB();
> }
>
> form.setCollection = _collection
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message