I have a filter in one of the referenced libraries. I have configured this filter in web.xml of my application.
Consider I have the filter in abcd.jar
.
I am configuring it to my web.xml as
<filter>
<filter-name>message</filter-name>
<filter-class>com.test.myfilter</filter-class>
<init-param>
<param-name>message</param-name>
<param-value>A message for you!</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>message</filter-name>
<url-pattern>/test/filter2*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
When browsed the url containing the match localhost:8080/test/filter2.jsp
. I could access this correctly. But not sure whether my filter is called successfully or not.
I cannot test it by adding the print statements in the filter class because it is from referenced libraries.
Is there any other way to test it.