Filter Utilities

Provides basic support of servlet filter. Boilerplate code etc. It provides a boilerplate implementation of the Filter interface. The GenericFilter provides a getter and setter for the FilterConfig object and ensures that this is set when init is called. The init method also calls the configureFilter method after the FilterConfig object is set and can be used by subclasses to process the filter config during initiation. It also provides an empty implementation of the destory method. The only method that requires implementation is the doFilter method. The GenericHTTPFilter extends the GenericFilter class, it provides a doFilter method that attempts to cast the ServletRequest and ServletResponse objects to HttpServletRequest and HttpServletResponse objects. If these objects can be cast successfuly then it calls the doHTTPFilter method and passes the cast objects references. If the objects cannot be cast a ServletException is thrown. The doHTTPFilter method is abstract and must be implemented by subclasses.

License

License

GroupId

GroupId

com.mattunderscore
ArtifactId

ArtifactId

filter-utils
Last Version

Last Version

0.2.8
Release Date

Release Date

Type

Type

jar
Description

Description

Filter Utilities
Provides basic support of servlet filter. Boilerplate code etc. It provides a boilerplate implementation of the Filter interface. The GenericFilter provides a getter and setter for the FilterConfig object and ensures that this is set when init is called. The init method also calls the configureFilter method after the FilterConfig object is set and can be used by subclasses to process the filter config during initiation. It also provides an empty implementation of the destory method. The only method that requires implementation is the doFilter method. The GenericHTTPFilter extends the GenericFilter class, it provides a doFilter method that attempts to cast the ServletRequest and ServletResponse objects to HttpServletRequest and HttpServletResponse objects. If these objects can be cast successfuly then it calls the doHTTPFilter method and passes the cast objects references. If the objects cannot be cast a ServletException is thrown. The doHTTPFilter method is abstract and must be implemented by subclasses.

Download filter-utils

How to add to project

<!-- https://jarcasting.com/artifacts/com.mattunderscore/filter-utils/ -->
<dependency>
    <groupId>com.mattunderscore</groupId>
    <artifactId>filter-utils</artifactId>
    <version>0.2.8</version>
</dependency>
// https://jarcasting.com/artifacts/com.mattunderscore/filter-utils/
implementation 'com.mattunderscore:filter-utils:0.2.8'
// https://jarcasting.com/artifacts/com.mattunderscore/filter-utils/
implementation ("com.mattunderscore:filter-utils:0.2.8")
'com.mattunderscore:filter-utils:jar:0.2.8'
<dependency org="com.mattunderscore" name="filter-utils" rev="0.2.8">
  <artifact name="filter-utils" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.mattunderscore', module='filter-utils', version='0.2.8')
)
libraryDependencies += "com.mattunderscore" % "filter-utils" % "0.2.8"
[com.mattunderscore/filter-utils "0.2.8"]

Dependencies

provided (1)

Group / Artifact Type Version
javax.servlet : servlet-api jar 2.4

test (2)

Group / Artifact Type Version
junit : junit jar 4.11
org.mockito : mockito-all jar 1.9.5

Project Modules

There are no modules declared in this project.

Versions

Version
0.2.8
0.2.7
0.2.6
0.2.5
0.2.3
0.2.2
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0