据我所知我可以访问web.xml文件 <context-param> 通过让我的班级 ServletContextListener 使用 ServletContext.getInitParam(String) 但由于只有一个类实例会收到 contextInitialized(ServletContextEvent sce) ServletContext 类的静态成员。
<context-param>
ServletContextListener
ServletContext.getInitParam(String)
contextInitialized(ServletContextEvent sce)
ServletContext
MessageContext 如中所述 How can I access the ServletContext from within a JAX-WS web service?
MessageContext