-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpringBoot: use interceptors with Katharsis? #420
Comments
Katharsis has own interceptors too. For your question, Spring interceptors are sitting in spring dispatch servlet. when you configuring Katharsis as a filter, they are in the different branches, so the answer is no. But it's easy to setup Katharsis as a spring controller and make interceptor work. In most case, it's not necessary. Katharsis is focused on Jsonapi, it solves the problem about jsonapi and does it well. |
@jianglibo do you have an example of how to setup Katharsis as a Spring Controller and/or how to use Katharsis interceptors? |
Reference the KatharsisFilterV2 class and look at the doFilter code, copy all code to your new created class, for example, named "KatharsisProcessor". Because Katharsis's code is clean and tidy, It's a simple job. after that, create a controller like below.
|
Hmm, That's interesting. |
@jianglibo this is great. It's not quite as easy as you suggest, but generally it looks to work. It also solves my other issue because I can have more specific paths for endpoints I want to bypass katharsis. This might be a good example. Here's the documentation on @RequestMapping and regexes. http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping-uri-templates-regex |
Is it possible to use Spring interceptors with Katharsis? It seems unlikely since Katharsis ends up bypassing Spring MVC which is what provides interceptors, but I thought I would ask.
The text was updated successfully, but these errors were encountered: