Skip to content
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

ApplicationContext-based initialization of reactive WebFilter, WebHandler, WebExceptionHandler infrastructure [SPR-14837] #19403

Closed
spring-projects-issues opened this issue Oct 21, 2016 · 2 comments

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 21, 2016

Rossen Stoyanchev opened SPR-14837 and commented

At present DispatcherHandler discovers the infrastructure it relies on in an ApplicationContext. The DispatchHandler however is itself expected to be instantiated and provided to the WebHttpHandlerBuilder along with instances of WebFilter and WebExceptionHandler.

As a practical example limitation the @EnableWebReactive configuration itself cannot automatically register a WebFilter for encoding links to static resources and that has to be left as an exercise for applications to do. Furthermore Spring Security will need to participate in the registration of filters which is also the motivation behind #19099. Coupled with that at present WebFilter is the only request interception mechanism exposed and any such mechanism should be easily accessible through a WebReactiveConfigurer for applications to use much like the registration of HandlerInterceptor's today.

The ability to declare WebExceptionHandler through WebReactiveConfigurer is also going to be very useful and along the same lines any properties that DispatcherHandler may expose in the future will be more easily configurable.

Spring Boot does mitigate these issues and has already done the same for Servlet-based applications. However on the reactive side it makes sense to provide a more complete ApplicationContext-based initialization mechanism for reactive web applictaions.


Affects: 5.0 M2

Issue Links:

  • #19099 Reactive WebFilter registration mechanism ("supersedes")

Referenced from: commits 33dbbce

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 21, 2016

Rossen Stoyanchev commented

If this works out it would supercede #19099.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 2, 2016

Rossen Stoyanchev commented

WebHttpHandlerBuilder now has a static factory method that initializes the builder from an ApplicationContext detecting WebFilter's, WebExceptionHandler's, and a target WebHandler by well-known name. The same is now also used in the DispatcherHandler#toHttpHandler(ApplicationContext) shortcut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants