I have this problem, I’m trying to put a String variable in the value attribute of @RequestMapping annotation:
private static final String PREVIEW = "/preview/anything";
...
@RequestMapping(value=PREVIEW, method=RequestMethod.POST)
Could I do this?
Thanks in advance
Yes you can although IMHO it’s less readable. You normally define a constant if you want to use it in many places but in this case I’d prefer to see the url mapping directly over the method.