Reactive HTTP request forwarding [SPR-14537] #19106
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
type: enhancement
A general enhancement
Rob Winch opened SPR-14537 and commented
Here is a scenario I find it very useful:
Someone is using Spring Security and we need to present the user with an "authentication prompt". Often times this will vary by content type. So for example, I might need to return an HTTP Basic prompt for application/json but redirect to an HTML page for html request. In the json case the result might even contain some JSON in the body giving the error message.
If we support a concept like forward, this can make it easy to define a Spring
@RequestMapping
endpoint to process it. This means that the user can easily leverage things like type conversion, argument resolvers, etc.Otherwise, (as far as I can tell) Spring Security must provide support for all these things or handicap the user with a less flexible API.
I do acknowledge having different "dispatch" types adds quite a bit of complexity, so that might not be worth the tradeoff. However, I thought it was worth bringing up for discussion
Rossen Stoyanchev points out that this would be useful in error handling (i.e. similar to global error handler "forwards" to a controller).
Affects: 5.0 M1
Issue Links:
1 votes, 6 watchers
The text was updated successfully, but these errors were encountered: