New controller for Spring MVC using Lambda [SPR-12954] #17546
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Toshiaki Maki opened SPR-12954 and commented
After Java SE 8 has been released, some frameworks using lambda appear.
For example Spark, Siden.
These frameworks are inspired by Sinatra and will resolve "Annotation Hell" which revealed after "XML Hell" had been cleared.
Spring MVC has a good mechanism to abstract controller layer (
HandlerMapping
,HandlerAdopter
).To implement these, Spring MVC can have a power to make use of lambda.
I've created a prototype for Spring MVC to provide a router like Sinatra.
https://github.com/making/new-controller
RouterHandlerMapping is a key component.
So far, this prototype does not use the url matching algorithm which
@MVC
uses. But you can see how this controller could be used.Sample code is following:
How do you think about this idea?
Issue Links:
2 votes, 9 watchers
The text was updated successfully, but these errors were encountered: