Context-params used inside web.xml

Is there a way to use contextual parameters inside 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> ... 
+4
source share
1 answer

When implementing a filter, you should probably read the <init-param> parameter of the filter. There, instead of reading the filter parameter, you can directly read the context parameter using:

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

Does this solve your question?

+1
source

All Articles