Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: reading data from struts-config.xml

Stanislav

2007-01-12

Replies:

Yes, you helped me, but where can i find list of all posible properties that i can get from
DataSourceConfig?

Tnx!

From: "Nuwan Chandrasoma" <mymailnot@(protected)>
To: <skomlena@(protected)>
Subject: Re: reading data from struts-config.xml
Date: Fri, 12 Jan 2007 15:21:06 -0000

----- Original Message Follows -----
> Hi,
>
> Get the module confing and from there you can get the data source
> configarations., in this object there is a Map which contains the
> properties, you can get it from there..,
>
> eg:-
> ModuleConfig config =
> (ModuleConfig)aRequest.getAttribute(Globals.MODULE_KEY);
>
>
> DataSourceConfig dscs[] = config.findDataSourceConfigs();
>
>
> dscs[0].getProperties().get("");
>
> I hope this would work, i havent tested the code in the above.., but i am
> sure it would work.. please teset.
>
> Thanks,
>
> Nuwan
>
>
>
> ----- Original Message -----
> From: "Stanislav" <skomlena@(protected)>
> To: <user@(protected)>
> Sent: Friday, January 12, 2007 9:32 AM
> Subject: Re: reading data from struts-config.xml
>
>
> > Yes!
> >
> > inside <data-sources> and then inside <data-source
> > type="org.apache.commons.dbcp.BasicDataSource">
> >
> >
> >
> > From: "Nuwan Chandrasoma" <mymailnot@(protected)>
> > To: <skomlena@(protected)>
> > Subject: Re: reading data from struts-config.xml
> > Date: Fri, 12 Jan 2007 15:04:36 -0000
> >
> > ----- Original Message Follows -----
> >> Hi,
> >>
> >> Where have you specified this property?.. inside <data-source> in
> >> struts-config.xml or some where else?
> >>
> >> Thanks,
> >>
> >> Nuwan
> >>
> >> ----- Original Message -----
> >> From: "Stanislav" <skomlena@(protected)>
> >> To: <user@(protected)>
> >> Sent: Friday, January 12, 2007 9:11 AM
> >> Subject: reading data from struts-config.xml
> >>
> >>
> >> > Hi!
> >> >
> >> > In struts-config.xml i defined database connection settings.
> >> > Partuculary
> >> > database name.
> >> >
> >> > code:
> >> > <set-property property="url"
> >> > value="jdbc:microsoft:sqlserver://xxx.xxx.xxx.xxx:1433;DatabaseName=SomeName_test
> >> > ;SelectMethod=Cursor" />
> >> >
> >> > Is there any to detect database name in Action class? I want to check
> >> > db
> >> > name, and if it's test db
> >> > to put some information in .jsp.
> >> >
> >> > Tnx in advance,
> >> > Stanislav
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> > For additional commands, e-mail: user-help@(protected)
> >> >
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.