0

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.

Duncan Jones
  • 67,400
  • 29
  • 193
  • 254
Patan
  • 17,073
  • 36
  • 124
  • 198

1 Answers1

0

Create method break-point in your third party jar file. And then wait to see if the break-point is triggered or not.

For creating the break-point in third party library in eclipse, open the class file in your jar in project explorer, then open the outline, right click and add the break-point.

Community
  • 1
  • 1