You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris <ch...@yahoo.fr> on 2014/06/03 13:10:52 UTC
Do properties written in an external file need ApplicationAware ?
Hello,I would like to use properties (*) written in an external file, and read them only once.
Do I have to use ApplicationAware, or something else.
Whatever, could you give examples please ?
(*) some properties like JDBC or LDAP connection's parameters.
Thanks
Chris
Re: Do properties written in an external file need ApplicationAware ?
Posted by Chris <ch...@yahoo.fr>.
Hello Antonios,
Thanks.
I'll try it and see how I can manage it.
Chris
Le Mardi 3 juin 2014 13h35, Antonios Gkogkakis <gk...@tcd.ie> a écrit :
Hi Chris,
I'm not sure if struts has a feature that would read property files and put
them in the Application scope for you automatically.
You can have a look at
http://commons.apache.org/proper/commons-configuration/userguide/user_guide.html
which will allow you to read the properties file. Then you have several
options for exposing the properties to your Actions, one of them would be
to store an object in the Application map and have your actions implement
ApplicationAware.
Antonios
On 3 June 2014 12:10, Chris <ch...@yahoo.fr> wrote:
> Hello,I would like to use properties (*) written in an external file, and
> read them only once.
> Do I have to use ApplicationAware, or something else.
> Whatever, could you give examples please ?
>
> (*) some properties like JDBC or LDAP connection's parameters.
>
> Thanks
>
> Chris
Re: Do properties written in an external file need ApplicationAware ?
Posted by Antonios Gkogkakis <gk...@tcd.ie>.
Hi Chris,
I'm not sure if struts has a feature that would read property files and put
them in the Application scope for you automatically.
You can have a look at
http://commons.apache.org/proper/commons-configuration/userguide/user_guide.html
which will allow you to read the properties file. Then you have several
options for exposing the properties to your Actions, one of them would be
to store an object in the Application map and have your actions implement
ApplicationAware.
Antonios
On 3 June 2014 12:10, Chris <ch...@yahoo.fr> wrote:
> Hello,I would like to use properties (*) written in an external file, and
> read them only once.
> Do I have to use ApplicationAware, or something else.
> Whatever, could you give examples please ?
>
> (*) some properties like JDBC or LDAP connection's parameters.
>
> Thanks
>
> Chris