Mappings

The mappings endpoint provides information ;about different service endpoints that are exposed from the application:

  • URI
  • Request methods
  • Bean
  • Controller methods exposing the service

Mappings provides ;a collated list of all @RequestMapping paths. An extract from the response of the /application/mappings endpoint is shown here. ;We can see mappings of the different controller methods that were created earlier in this book:

"{[/welcome-internationalized],methods=[GET]}": {
"bean": "requestMappingHandlerMapping",
"method": "public java.lang.String
com.mastering.spring.springboot.controller.
BasicController.msg(java.uti l.Locale)"
},
"{[/welcome],methods=[GET]}": {
"bean": "requestMappingHandlerMapping",
"method": "public java.lang.String
com.mastering.spring.springboot.controller.
BasicController.welcome()"
},
"{[/welcome-with-object],methods=[GET]}": {
"bean": "requestMappingHandlerMapping",
"method": "public com.mastering.spring.springboot.
bean.WelcomeBeancom.mastering.spring.springboot.
controller.BasicController.welcomeWithObject()"
},
"{[/welcome-with-parameter/name/{name}],methods=[GET]}": {
"bean": "requestMappingHandlerMapping",
"method": "public
com.mastering.spring.springboot.bean.WelcomeBean
com.mastering.spring.springboot.controller.
BasicController.welcomeWithParameter(java.lang.String)"
},
"{[/users/{name}/todos],methods=[POST]}": {
"bean": "requestMappingHandlerMapping",
"method": "org.springframework.http.ResponseEntity<?>
com.mastering.spring.springboot.controller.
TodoController.add(java.lang.String,com.mastering.spring.
springboot.bean.Todo)"
},
"{[/users/{name}/todos],methods=[GET]}": {
"bean": "requestMappingHandlerMapping",
"method": "public java.util.List<com.mastering.spring.
springboot.bean.Todo>
com.mastering.spring.springboot.controller.
TodoController.retrieveTodos(java.lang.String)"
},
"{[/users/{name}/todos/{id}],methods=[GET]}": {
"bean": "requestMappingHandlerMapping",
"method": "public
org.springframework.hateoas.Resource<com.mastering.
spring.springboot.bean.Todo>
com.mastering.spring.springboot.controller.
TodoController.retrieveTodo(java.lang.String,int)"
},
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset