Skip to content

Make it easier to use WebFilter with Functional Web Framework [SPR-14979] #19545

@spring-projects-issues

Description

@spring-projects-issues

Sébastien Deleuze opened SPR-14979 and commented

Currently it seems to me there is no obvious way to use WebFilter with the Functional Web Framework without doing a cast like in this code sample. It is worth to notice that we expose only a HttpHandler return type in RouterFunctions.toHttpHandler() while the type actually returned in the implementation is a HttpWebHandlerAdapter that implements both HttpHandler and WebHandler. It could be nice to be able to get a WebHandler in order to make it easier to deal with WebFilter.

Not sure what is the best way to do that:

  • Add a RouterFunctions.toWebHandler() method?
  • Return HttpWebHandlerAdapter in RouterFunctions.toWebHandler()?
  • Introduce a new interfaces that implements both HttpHandler and WebHandler to avoid exposing HttpWebHandlerAdapter with is an implementation detail?

This question of using WebFilter versus HttpHandler is maybe something worth to discuss with Rossen Stoyanchev.


No further details from SPR-14979

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions