jfilter 技术上是利用了ControllerAdvice以及ResponseBodyAdvice 在beforeBodyWrite中进行响应内容的处理
jfilter利用了自定义注解技术,同时官方文档还是比较全的,值得学习下
参考处理流程
说明
实际上jersey 也提供了类似的能力(filter),功能上相比spring 的更加方便点ContainerResponseFilter, 提供open-metadata 对于es &事件处理&审计处理就是利用了
此能力,实现的功能很方便而且也很强大,此中设计模式是一个是值得参考的
参考资料
https://github.com/rkonovalov/jfilter
https://rkonovalov.github.io/projects/jfilter/1.0.17/
https://dzone.com/articles/spring-web-service-response-filtering
https://www.baeldung.com/jersey-filters-interceptors
https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/filters-and-interceptors.html
原文地址:https://www.cnblogs.com/rongfengliang/p/15617192.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。