In my application I delete image by passing image id to REST api like this.
DELETE http://localhost:8080/connect/images/123456/abcdef
So, I mapped this with spring MVC as follows
@ResponseBody
@RequestMapping(value="/images/{imageId}", method=RequestMethod.DELETE,
produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseObject deleteImage(final HttpServletResponse response, HttpServletRequest request, @PathVariable("imageId") final String imageId) {
return ResponseUtil.executeInTryCatch(new ResponseCallback() {
@Override
public Object execute() throws Throwable {
deleteImage(imageId);
return "Image deleted successfully";
}
});
}
But I am not able to fetch rest of URI after images to imageId path variable.
I want imageId should be 123456/abcdef
. Is there a way to extract using @PathVariable
regular expression support?