Siddharth
Siddharth

Reputation: 2254

How to check web.xml configuration during runtime?

I have a Java EE Interceptor in which I need to check whether a particular filter is a part of current web.xml configuration or not. Then how can I do that in runtime?

Upvotes: 0

Views: 358

Answers (1)

cilap
cilap

Reputation: 2333

I do not fully understand your requirement since EJBs (Interceptors) and Servlets are two different parts.

To access the Servlet configuration, which contain the filters. You can use these:

ServletContext#getFilterRegistrations()

http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#getFilterRegistrations%28%29

and ServletConfig

http://docs.oracle.com/javaee/6/api/javax/servlet/ServletConfig.html

Upvotes: 2

Related Questions