@RequestMapping (value = "/loadmenu", method =requestmethod.get) @ResponseBody PublicArraylist<treenode> LoadMenu (@RequestParam (value = "Node") String nodeId)throwsException {ArrayList<TreeNode> nodes =NewArraylist<treenode>(); if(TreeNode.ROOT.equals (nodeId)) {TreeNode node=NewTreeNode (); Node.setobjectid ("12345"); Node.settext ("Root"); Node.setleaf (false); Nodes.Add (node); } Else{TreeNode node=NewTreeNode (); Node.setobjectid ("23456"); Node.settext ("1"); Node.setleaf (true); Nodes.Add (node); } returnnodes; }
<?XML version= "1.0" encoding= "UTF-8"?><Beansxmlns= "Http://www.springframework.org/schema/beans"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xmlns:context= "Http://www.springframework.org/schema/context"xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ Spring-beans-3.0.xsd Http://www.springframework.org/schema/context Http://www.springframework.org/schema/context /spring-context-3.0.xsd "> <Context:annotation-config/> <Context:component-scanBase-package= "com" /> <BeanID= "JSON"class= "Org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" /> <Beanclass= "Org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> < Propertyname= "Messageconverters"> <List> <refBean= "JSON" /> </List> </ Property> </Bean></Beans>
Jar:jackson-core-asl-1.9.13.jar; Jackson-mapper-asl-1.9.13.jar 1.9.0 bag too old will not find class error
Ajax Request SPRINGMVC