<!-- json转换器 --> <bean id="jsonConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> <property name="supportedMediaTypes" value="application/json" /> </bean>
@Controller @RequestMapping("task") public class TaskControl { @RequestMapping("getUserById") @ResponseBody public List getUserById(Integer id) { return this.taskService.getUserById(id); } }
functon getUserById(id){ $.getJSON("task/getUserById",{id:id},function(data){ }); }