You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by satheesh <ts...@yahoo.co.uk> on 2008/09/12 08:53:12 UTC
Reading a properties file from Axis2 service class
Hi all,
I have written application using axis2 and deployed in Tomcat. I have to
read some values from properties file at run time? how can I define a
properties file in MyService.aar file read it in my service class ?
thank you in advance.
satheesh
--
View this message in context: http://www.nabble.com/Reading-a-properties-file-from-Axis2-service-class-tp19450498p19450498.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Reading a properties file from Axis2 service class
Posted by Deshan <de...@gmail.com>.
Hi Amila,
The following line of code in your previous reply;
MessageContext.getCurrentMessageContext().getAxisService().getParameter("propertyFileName").getValue()
Does this return a reference to the actual Properties file or the file name
as a string? It returns a string when I tried it out.
I need to access the values in the properties file from the service class.
Also, I need to update them. Would you be able to help me out here?
thanks,
Deshan
Amila Suriarachchi wrote:
>
> you can declare your property file name as a parameter in services.xml
>
> <parameter name="propertyFileName"><file Name></parameter>
>
> and access in the service class.
>
> MessageContext.getCurrentMessageContext().getAxisService().getParameter("propertyFileName").getValue()
>
> thanks,
> Amila.
>
>
>
> On Fri, Sep 12, 2008 at 12:23 PM, satheesh
> <ts...@yahoo.co.uk>wrote:
>
>>
>> Hi all,
>>
>> I have written application using axis2 and deployed in Tomcat. I have to
>> read some values from properties file at run time? how can I define a
>> properties file in MyService.aar file read it in my service class ?
>>
>> thank you in advance.
>> satheesh
>> --
>> View this message in context:
>> http://www.nabble.com/Reading-a-properties-file-from-Axis2-service-class-tp19450498p19450498.html
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
>
> --
> Amila Suriarachchi,
> WSO2 Inc.
>
>
--
View this message in context: http://www.nabble.com/Reading-a-properties-file-from-Axis2-service-class-tp19450498p19956404.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Reading a properties file from Axis2 service class
Posted by Amila Suriarachchi <am...@gmail.com>.
you can declare your property file name as a parameter in services.xml
<parameter name="propertyFileName"><file Name></parameter>
and access in the service class.
MessageContext.getCurrentMessageContext().getAxisService().getParameter("propertyFileName").getValue()
thanks,
Amila.
On Fri, Sep 12, 2008 at 12:23 PM, satheesh <ts...@yahoo.co.uk>wrote:
>
> Hi all,
>
> I have written application using axis2 and deployed in Tomcat. I have to
> read some values from properties file at run time? how can I define a
> properties file in MyService.aar file read it in my service class ?
>
> thank you in advance.
> satheesh
> --
> View this message in context:
> http://www.nabble.com/Reading-a-properties-file-from-Axis2-service-class-tp19450498p19450498.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Amila Suriarachchi,
WSO2 Inc.