@ResponseBody @RequestMapping(value = "/getJobDefinitionsList") public List<JobDefinition> getJobDefinitionsList( HttpServletResponse response, @RequestParam Map<String, Object> parameter) throws Exception { List<JobDefinition> list = new ArrayList<JobDefinition>(); JobDefinition jobDefinition = new JobDefinition(); jobDefinition.setId("1"); jobDefinition.setName("hello job"); ; list.add(jobDefinition); JobDefinition jobDefinition1 = new JobDefinition(); jobDefinition1.setId("2"); jobDefinition1.setName("hello job1"); ; list.add(jobDefinition1); JobDefinition jobDefinition2 = new JobDefinition(); jobDefinition2.setId("3"); jobDefinition2.setName("hello job2"); ; list.add(jobDefinition2); return list; }
@ResponseBody @RequestMapping(value = "/saveJobDefinition", method = RequestMethod.POST) public JobDefinition saveJobDefinition( @ModelAttribute("jobDefinitionForm") JobDefinition inParam, HttpServletResponse response) throws Exception { if (AssertHelper.empty(inParam.getId())) { inParam.setId(IdGenerator.getUUID()); jobDefinitionService.save(inParam); } else { jobDefinitionService.update(inParam); } inParam.setId(inParam.getId()); return inParam; }