4

Is there a way to use the context-params inside the web.xml

example

<context-param>
    <param-name>AUTH_SERVER</param-name>
    <param-value>10.126.35.10</param-value>
</context-param>
...

<filter>
    <filter-name>NtlmHttpFilter</filter-name>
    <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
    <init-param>
        AUTH_SERVER
    </init-param>
...
Apostelis
  • 65
  • 6

1 Answers1

1

When you implement the filter probably you have to read the <init-param> parameter of the filter. There, instead of reading the parameter of the filter, you can read directly the context param, using:

filterConfig.getServletContext().getInitParameter("paramName");

Does that solve your matter?

angel_navarro
  • 1,757
  • 10
  • 11
  • My problem is generated due to the fact that I need to authenticate the user on access, using ntlm and then I need to use those credentials to authorize the use depending on his selection further on. I know how to access the context-param in code, but I do not know if there's a way o access them inside the web.xml – Apostelis Sep 23 '13 at 09:28
  • The feature you describe is not possible. Source: http://stackoverflow.com/questions/13575015/can-context-param-be-referenced-inside-web-xml – angel_navarro Sep 23 '13 at 09:36