https://github.com/lazycece/au
Au is a filter framework. It is an extension based on servlet-filter.
https://github.com/lazycece/au
au filter request-wrapper response-wrapper servlet-filter
Last synced: 2 months ago
JSON representation
Au is a filter framework. It is an extension based on servlet-filter.
- Host: GitHub
- URL: https://github.com/lazycece/au
- Owner: lazycece
- License: apache-2.0
- Created: 2019-11-28T14:39:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-07-12T01:16:16.000Z (9 months ago)
- Last Synced: 2025-08-06T02:54:24.708Z (8 months ago)
- Topics: au, filter, request-wrapper, response-wrapper, servlet-filter
- Language: Java
- Homepage:
- Size: 177 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Au
[](https://search.maven.org/search?q=au-core)
[](https://www.apache.org/licenses/LICENSE-2.0.html)
[](https://github.com/lazycece/au/releases)
[中文](./README_zh_CN.md)
Au is a filter framework. It is an extension based on servlet-filter. It provides pre-filtering and
post-filtering of interceptor behavior. It also provides multiple reads of requests and a wrapper for response.
## Architecture
The architecture of Au as follows:

## Environment
Au environment dependency as follow:
|Au|Java|servlet-api|
|---|---|---|
|1.x|1.8+|javax.servlet-api:>=4.0.0|
|2.x|1.8+|jakarta.servlet-api:>=5.0.0|
|3.x|17+|jakarta.servlet-api:>=5.0.0|
## Quick Start
Complete example can view [au-example](https://github.com/lazycece/au/tree/master/au-example)
### Maven dependency
```xml
com.lazycece.au
au-core
${au.core.version}
```
### Filter
Defining `filter`,and implement the `AuFilter`.
```java
public class SimpleAuFilter implements AuFilter {
@Override
public String name() {
return "simple-filter";
}
@Override
public boolean preHandle() throws Exception {
// pre handle
return true;
}
@Override
public void postHandle() throws Exception {
// post-handle
}
}
```
Injecting `AuFilter`,and you can also set related policies for filters.
```java
AuManager auManager = AuManager.getInstance();
auManager.addAuFilter(SimpleAuFilter.class)
.excludePatterns("/a/b")
.includePatterns("/**")
.order(1);
auManager.setWrapper(true);
```
### Enable Au
Injecting `AuServletFilter` into `Servlet`, as follow(`jetty`):
```java
ServletContextHandler contextHandler = new ServletContextHandler();
contextHandler.setContextPath("/au");
server.setHandler(contextHandler);
contextHandler.addServlet(ExampleServlet.class, "/*");
contextHandler.addFilter(AuServletFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
```
## License
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.html)