Web services 从jax-ws-web服务获取参数

Web services 从jax-ws-web服务获取参数,web-services,parameters,web.xml,Web Services,Parameters,Web.xml,我想从web服务(jax ws)中的文件中检索字符串参数。我发现我无法使用FacesContext从web.xml读取参数。 此代码不起作用: fc=FacesContext.getCurrentInstance(); 字符串fileOpzionali=fc.getExternalContext().getInitParameter(“fileOpzionali”) 建议 谢谢您的web.xml中是否有类似的相应条目: <context-param> <p

我想从web服务(jax ws)中的文件中检索字符串参数。我发现我无法使用FacesContext从web.xml读取参数。 此代码不起作用:


fc=FacesContext.getCurrentInstance(); 字符串fileOpzionali=fc.getExternalContext().getInitParameter(“fileOpzionali”)
建议


谢谢

您的web.xml中是否有类似的相应条目:

    <context-param>
       <param-name>fileOpzionali</param-name>
       <param-value>VALUE</param-value>
    </context-param>

fileOpzionali
价值

@idarios那么我认为它应该会起作用。尝试获取ServletRequest并以这种方式获取参数,例如request.getSession().getServletContext()。。。