I have five web applications in my project and want to filter HTTP requests, but I don't want to write a Filter
class for each web application because there will be no application specific behaviour. What is the most practical way to do this?
I've tried creating only one Filter
in another class library called MyClassLibrary
but it doesn't work. Other classes in this library can be used by the web applications so I don't think there's a reference problem.
The web.xml
filter part for one of the applications is:
<filter>
<filter-name>SampleFilter</filter-name>
<filter-class>MyClassLibrary.Filters.SampleFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SampleFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
This causes an exception:
java.lang.ClassNotFoundException: MyClassLibrary.Filters.SampleFilter
Platform : Windows, NetBeans, GlassFish
Please check the following
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With