Skip to main content

Accessing Servlet init-params

2 replies [Last post]
thecypher11
Offline
Joined: 2008-03-12
Points: 0

Hi All,

I've been searching for hours, and cannot find a way to access Servlet init-params in my JAX-WS WebService.

Here is a snippet from my web.xml

JAX-WS endpoint
WSServlet
WSServlet
com.sun.xml.ws.transport.http.servlet.WSServlet
1

myInitParam
myInitParamValue

I would like to have multiple servlets, each with a different init-param. I am aware of how to discover context params, through the ServletContext retrieved from the MessageContext, but I cannot find a way to access the Servlet itself, the ServletConfig, or most importantly the init-params for the Servlet.

If anyone could help with this I would be extremely grateful. Please let me know if my problem could be any clearer.

Thank you for your time,
Evan Worley

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
thecypher11
Offline
Joined: 2008-03-12
Points: 0

Does anyone know if this is even possible? I saw a question like mine from Feb that was never answered, and I am starting to wonder if JAX-WS simply does not support servlet init-params.

Thanks for any help,
Evan

jitu
Offline
Joined: 2003-06-14
Points: 0

You could get the ServletContext's params since ServletContext is available from MessageContext. I think we should extend WSWebServiceContext to provide these parameters. Then the endpoint applications can get the access to these params.