I have annotated controller which contains several methinds mapped on urls. Like this:
@Controller
public class CategoryController {
@RequestMapping(value = "/addCategories")
public void addCategories(@RequestParam(value = "data") String jsonData) throws ParseException
@RequestMapping(value = "/getNext")
public void getNext(@RequestParam(value = "data") String jsonData) throws ParseException
...
}
Methods need to parse json request and do perform some actions. Parsing request may produce checked ParseException
which I can handle in method or add throws
to its signature. I prefer second approach since in this I don't want additional try/catch in code.
So the question is how to configure and code handler for controller methods?