Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value = "/contents", produces="application/json")
- public @ResponseBody List<ContentVO> compare(@RequestParam("component") long componentId, Model model) throws ServiceException {
- List<Map<String, Object>> rawData = contentService.getContent(componentId);
- // throw some logging here
- List<ContentVO> list;
- try {
- list = ReflectionUtils.convert(rawData, ContentVO.class);
- // and throw some logging here
- return list;
- } catch (InstantiationException | IllegalAccessException e) {
- throw new ServiceException(e);
- }
- @ExceptionHandler( ServiceException.class )
- public String handleServiceException( ServiceException e ) {
- return e.getMessage();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement