I have a query displayed as
@RequestMapping(value = "/path", method = RequestMethod.POST) public ModelAndView createNewItem(@ModelAttribute PostRequest request)
PostRequest has some properties, for example, for example. userName (getUserName()/setUserName()) , but the client sends parameters such as user_name=foo instead of userName=foo . Is there an annotation or a custom mapping interceptor to do this without putting all these ugly setUser_name() methods in setUser_name() ?
Since this happens very often (I have to implement an API where everything uses underscores), some implementation efforts are acceptable.
source share