java - Remove direct access to "/" on spring boot -


i have spring boot application have 2 endpoints defined.

    @requestmapping(value = "/getallfeatures", method = requestmethod.get)         @cacheable("features")         public responseentity<?> getallfeatures() {     ...     }      @requestmapping(name = "/getfeaturestatus", method = requestmethod.get)         @cacheable("features")         public responseentity<?> getfeaturestatus(@requestparam(value = "groupname", required = false) string groupname,                 @requestparam(value = "featurename", required = false) string featurename) { ...     } 

and have defined context server.context-path=/abc

how problem when call on /abc/ application gives me valid response. have never mapped "/" in rest controller. ideas on how block requests "/". application doesn't require kind of spring security.

it should

 @requestmapping(path= "/getfeaturestatus"....) 

instead of

  @requestmapping(name = "/getfeaturestatus"....) 

the name attribute assigns name mapping.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -