Hi,

no, I have defined a data-source in my struts-config.xml:

        <data-sources>
        <data-source type="org.apache.commons.dbcp.BasicDataSource">
            <set-property property="defaultAutoCommit" value="false"/>
            <set-property property="maxActive" value="-1"/>
            <set-property property="maxIdle" value="-1"/> 
            <set-property property="minIdle" value="0"/>
            <set-property property="maxWait" value="10000"/>
            <set-property property="description" value="DOS:PostgreSQL 
Datasource configuration"/>
            <set-property property="driverClassName" 
value="org.postgresql.Driver" />
            <set-property property="url" 
value="jdbc:postgresql://localhost/dosloc?charSet=LATIN1" />
            <set-property property="username" value="postgres" />
            <set-property property="password" value="postgres" />
        </data-source>
    </data-sources> 

If I write the attribute "key", I will get null in my Servlet:


<data-source type="org.apache.commons.dbcp.BasicDataSource" key="dsDOS">
        ...


DataSource ds = (DataSource)
                        getServletContext().getAttribute("dsDOS");


kind regards,

Frank

-----Ursprüngliche Nachricht-----
Von: Martin Gainty [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 26. März 2007 15:02
An: Struts Users Mailing List
Betreff: Re: DATA_SOURCE_KEY in Struts 1.3.8?


Have you considered using Spring to inject DataSource bean into the context?
http://www.springframework.org/docs/reference/beans.html

M--
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of 
the individual or entity to which it is addressed and may contain information 
that is privileged, proprietary , confidential and exempt from disclosure. If 
you are not the intended recipient, you are notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le 
cas échéant) s'adresse au destinataire indiqué et peut contenir des 
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le 
destinataire de ce document, nous vous signalons qu'il est strictement interdit 
de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Otto, Frank" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Monday, March 26, 2007 5:42 AM
Subject: DATA_SOURCE_KEY in Struts 1.3.8?


> Hi,
> 
> I have used struts 1.2 in my app. Now, I want to upgrade to struts 1.3.8 and 
> I get the error "cannot find symbol Globals.DATA_SOURCE_KEY".
> 
> I don't find information in the struts javadoc, what I have to use instead. 
> Can someone help me?
> 
> 
> kind regards,
> 
> Frank
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to