You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Ramin, Arash" <Ar...@microman.net> on 2002/04/29 16:55:52 UTC
datasources
We have a couple datasources defined in our application (in
struts-config.xml) under separate keys (one is for our dev environment, and
the other for production). The default behaviour for Struts is to
initialize all the defined datasources and make them available to the
application. Depending on which environment we're running in, only one of
them should be initialized.
Can I tell Struts not to initialize the datasources automatically so I can
do it manually in my own servlet? I already have a constant defined in a
resource file so my application can determine which datasource to use. Any
suggestions?
(Struts 1.1 beta 1, Tomcat 4.03, Sun JDK 1.3.1)
Thanks,
Arash
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: datasources
Posted by Eddie Bush <ek...@swbell.net>.
You could always comment one of them out, depending on which environment
you're running in, and save yourself having to do anything else =)
... I'm lazy though.
Just surround the definition you don't want initialized with:
<!--
You just made your datasource definition a comment.
Restart Tomcat =)
-->
You'll have to look to another person to provide you a way to initialize the
datasource yourself if you don't like my suggestion. I tend to let Struts
do whatever it can for me.
HTH,
Eddie
----- Original Message -----
From: "Ramin, Arash" <Ar...@microman.net>
To: <st...@jakarta.apache.org>
Sent: Monday, April 29, 2002 9:55 AM
Subject: datasources
>
> We have a couple datasources defined in our application (in
> struts-config.xml) under separate keys (one is for our dev environment,
and
> the other for production). The default behaviour for Struts is to
> initialize all the defined datasources and make them available to the
> application. Depending on which environment we're running in, only one of
> them should be initialized.
>
> Can I tell Struts not to initialize the datasources automatically so I can
> do it manually in my own servlet? I already have a constant defined in a
> resource file so my application can determine which datasource to use.
Any
> suggestions?
>
> (Struts 1.1 beta 1, Tomcat 4.03, Sun JDK 1.3.1)
>
> Thanks,
>
> Arash
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>