i'm using struts 1.0.1, app requiring multiple datasources

in web.xml i have
        <context-param>
                <param-name>dfltDataSourceRef</param-name>
                <param-value>jdbc/ejif</param-value>
        </context-param>
 <context-param>
   <param-name>GLDataSourceRef</param-name>
   <param-value>jdbc/flexi</param-value>
 </context-param>

i get these values by in a servlet by
    dsource = getServletContext().getInitParameter("GLDataSourceRef");

in fact i do this in a startup servlet and cache them in a data service so
that business tier can get hold of 
them without being aware of the web context
e.g.
    // if  not set, then no point in trying
    if (dsource != null) {
      EnvironmentDataServiceDelegate.setGLDataSourceRef(dsource);
      EJifUtils.debug("Set GLDataSourceRef");
    }

:-)
Tom Lister
* 020 7612 3030
* [EMAIL PROTECTED]


-----Original Message-----
From: Smith, Johnathan M. [mailto:[EMAIL PROTECTED]]
Sent: 06 September 2002 13:55
To: '[EMAIL PROTECTED]'
Subject: InitParameter and Actions


In the pass I setup InitParameter's in my web.xml file for my control
(servlet) and the control pass the string on to each model.  How can I do
the same thing in Struts. I need to pass a string like a database name to
every action object.  I would like it in a files so if I go from dev to QA
to prod I only have to change the name in a file


Johnathan Mark Smith
Divisional Assistant Vice President
Information Systems Division

Phone: (201) 352-1387
Pager: (201) 718-1370
Email: [EMAIL PROTECTED]
Text Messaging: [EMAIL PROTECTED]



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


***************************************************************************
This communication (including any attachments) contains confidential information.  If 
you are not the intended recipient and you have received this communication in error, 
you should destroy it without copying, disclosing or otherwise using its contents.  
Please notify the sender immediately of the error.

Internet communications are not necessarily secure and may be intercepted or changed 
after they are sent.  Abbey National Treasury Services plc does not accept liability 
for any loss you may suffer as a result of interception or any liability for such 
changes.  If you wish to confirm the origin or content of this communication, please 
contact the sender by using an alternative means of communication.

This communication does not create or modify any contract and, unless otherwise 
stated, is not intended to be contractually binding.

Abbey National Treasury Services plc. Registered Office:  Abbey National House, 2 
Triton Square, Regents Place, London NW1 3AN.  Registered in England under Company 
Registration Number: 2338548.  Regulated by the Financial Services Authority (FSA).
***************************************************************************


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

Reply via email to