Which AJAX libraries work well with Spring MVC?
I am new to development using Spring and Spring MVC. From the documentation at http://www.springsource.org I still don't understand which AJAX Spring MVC framework has built-in or which third-party APIs and tools may be suggested to work well with Spring MVC application development.
All recommendations are welcome.
I looked at previous SO discussions on this, but I did not get a clear indication.
Spring is very easy to use with Ajax. If Jackson is on the way to the class, Spring can use it to return JSON to the caller. Something like that:
@RequestMapping( "/my/path" ) public @ResponseBody MyObject doSomething( @RequestParam Long myVal ) { MyObject result = new MyObject( myVal ); // do something interesting return result; }
jQuery ( javascript), http://myserver/my/path JSON.
http://myserver/my/path
Google GSON . :
@RequestMapping( "/my/path" ) public ResponseEntity<String> MyObject doSomething( @RequestParam Long myVal ) { MyObject result = new MyObject( myVal ); // do something interesting HttpHeaders headers = new HttpHeaders(); headers.set( "Content-Type", "application/json" ); String json = gson.toJson( result ); return new ResponseEntity<String>( json, headers, HttpStatus.CREATED ); }
, . , .
http://blog.springsource.org/2010/01/25/ajax-simplifications-in-spring-3-0/
, Spring MVC UK UI - Rich Web Application Spring MVC CRUD Demo
Spring MVC UK UI. ( Java-)
Spring, , Javascript. , Springsource - - Javascript . Ajax - , Javascript, - . AJAX, , JSON XML. , , , . Javascript, , , , jQuery DOM . , Spring MVC Jackson JSON jQuery . jQuery jQuery-UI, Javascript- . , MVC , , .
Spring JS supports the Dojo JavaScript framework. Spring js