I would like to write custom annotations, that would modify Spring request or path parameters according to annotations. For example instead of this code:
@RequestMapping(method = RequestMethod.GET)
public String test(@RequestParam("title") String text) {
text = text.toUpperCase();
System.out.println(text);
return "form";
}
I could make annotation @UpperCase :
@RequestMapping(method = RequestMethod.GET)
public String test(@RequestParam("title") @UpperCase String text) {
System.out.println(text);
return "form";
}
Is it possible and if it is, how could I do it ?
As the guys said in the comments, you can easily write your annotation driven custom resolver. Four easy steps,
or the java config