开发者

Different ways of accessing configuration parameters from a JAX-WS service

开发者 https://www.devze.com 2022-12-26 04:12 出处:网络
As far as I know开发者_如何学C I can access the web.xml <context-param>s by making my class implement ServletContextListener and use the ServletContext.getInitParam(String) to read them, but it´

As far as I know开发者_如何学C I can access the web.xml <context-param>s by making my class implement ServletContextListener and use the ServletContext.getInitParam(String) to read them, but it´s cumbersome as only one instance of the class will receive the contextInitialized(ServletContextEvent sce) call, so I need to make the ServletContext an static member of the class.

What other ways exist of setting conf params at deployment time and what are the recommended ones?


Ok it seems that the best way of actually getting the ServletContext is via the MessageContext as described in How can I access the ServletContext from within a JAX-WS web service?

0

精彩评论

暂无评论...
验证码 换一张
取 消