I did some digging, and I was able to get the ServletContext via:
MessageContext context = MessageContext.getCurrentMessageContext();
ServletContext servletContext =
(ServletContext)context.getProperty("transport.http.servletContext");
feh wrote:
>
>
>
> Raghu Upadhyayula wrote:
>>
>> Hi Feh,
>>
>> You can get the ServletContext as follows (In Axis 1.3). Which
>> Axis version are you using?
>> For Axis 1.3
>> MessageContext context = MessageContext.getCurrentContext();
>> HttpServlet servlet =
>> (HttpServlet)context.getProperty(HTTPConstants.MC_HTTP_SERVLET);
>> ServletContext servletContext = servlet.getServletContext();
>>
>> For Axis2 1.2
>> MessageContext context =
>> MessageContext.getCurrentMessageContext();
>> HttpServlet servlet =
>> (HttpServlet)context.getProperty(HTTPConstants.MC_HTTP_SERVLET);
>> ServletContext servletContext = servlet.getServletContext();
>>
>> Thanks
>> Raghu
>>
>>
>
> Thanks Raghu.
>
> I'm using Axis2...I gave the code above a try, and while I am able to get
> the MessageContext, when I try to get the MC_HTTP_SERVLET property, the
> return value is null.
>
> Any guesses as to why?
>
>
--
View this message in context:
http://www.nabble.com/access-to-ServletConfig-from-service-class-tf4269706.html#a12163891
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]