How do i get the requestmapping value in the controller?

后端 未结 5 2087
名媛妹妹
名媛妹妹 2021-02-05 04:43

In the controller , i have this code, somehow, i want to get the request Mapping value \"search\". How is it possible ?

 @RequestMapping(\"/search/\")     
 publ         


        
5条回答
  •  爱一瞬间的悲伤
    2021-02-05 05:31

    @RequestMapping("foo/bar/blub")     
    public Map searchWithSearchTerm(@RequestParam("name") String name, HttpServletRequest request) {
      // delivers the path without context root 
      // mapping = "/foo/bar/blub"
      String mapping = request.getPathInfo();
      // more code here
    }
    

提交回复
热议问题