Why does Spring allow the controller to match annotated request requests with private methods?

This just happened today in the Spring MVC cotnroller class,

@RequestMapping(value = { "/foo/*" }, method = { RequestMethod.GET}) private String doThing(final WebRequest request) { ... return "jsp"; } 

It's a little harder to write a test, I will probably change it to public, but what's the point of allowing comparisons for private methods?

+4
source share
1 answer

Java does not provide a mechanism to limit the purpose of access modifier-based annotations.

+4
source

All Articles