In the controller , i have this code, somehow, i want to get the request Mapping value \"search\". How is it possible ?
@RequestMapping(\"/search/\")
publ
For Spring 3.1 and above you can use ServletUriComponentsBuilder
@RequestMapping("/search/")
public ResponseEntity> searchWithSearchTerm(@RequestParam("name") String name) {
UriComponentsBuilder builder = ServletUriComponentsBuilder.fromCurrentRequest();
System.out.println(builder.buildAndExpand().getPath());
return new ResponseEntity("OK", HttpStatus.OK);
}