RE: static variables in actions

2004-02-03 Thread Nicolás de Amorrortu
You can also try the Providers Framework that we have posted to the
sourceforge (http://providers.sourceforge.net).
It was developed to solve the problem that you described. With this
framework you define your collections on a XML file, and then you can
use it through select tag (of struts) using de "optionsTag" provided
with the framework.
The collections could be defined to be retrieved from DataSource or
Fixed Collections.
The DataSource definition is something like ...





query
select * from cities



Then in your JSP you use this collection (named 'cities') like this




Cheers,
Nicolás


-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED] 
Sent: Martes, 03 de Febrero de 2004 11:40 a.m.
To: Struts Users Mailing List
Subject: RE: static variables in actions


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:[EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las 
personas direccionadas en el mail y puede contener informacion (i)de propiedad 
exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier 
opinion en el contenido, es exclusiva de su autor y no representa necesariamente la 
opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion 
esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna 
por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha 
recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo 
inmediatamente junto con todas las copias del mismo, notificando al remitente. No 
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus 
partes si usted no es el destinatario. Muchas gracias.



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



RE: static variables in actions

2004-02-03 Thread Robert Taylor
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:[EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



static variables in actions

2004-02-03 Thread Menke, John
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]