mercredi 8 avril 2015

passing .(dot) in url send request to different method

I am trying to pass dot in URL.


I am just trying to verify my validator. All special character is passing through URL and my validator for numeric is working fine.


I have 2 methods:



@RequestMapping(value = "/{cname}/pro", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<?> listAllPropClass(@PathVariable String cname, @RequestParam(value = "class", defaultValue = "", required = false) String className) {

}

@RequestMapping(value = "/{cname}/pro/{id:.+}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<?> getPropById(@PathVariable String cname, @PathVariable String id) {

}


But when I am passing .(dot) in URL like:



http://localhost:1080/api/on/pro/.


then it pass request to first method not to second method. I want that request should come to second method.


Any idea guys.


Aucun commentaire:

Enregistrer un commentaire