I've been thinking all the day about how I can setup Spring MVC 3.0 (more specifically REST capabilities), with GWT. That is, I don't wanna use GWT RPC anymore, the communication will be made through REST. The problem is that I'm very new with the Spring Framework, and the only tutorials I found, they were using JSP, that's exactly where I get stuck... Is there a way to play with Spring without JSP page, only using the GWT view?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I assume what your trying to do is have a Spring controller return JSON or XML data?
There are two ways to do this:
Both methods are covered in some detail here : http://hillert.blogspot.com/2011/01/rest-with-spring-contentnegotiatingview.html
The spring people cover the @RequestBody method here: http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/
Here is the blog post covering the ContentNegotiatingViewResolver : http://blog.springsource.com/2009/03/08/rest-in-spring-3-mvc/
Sample code can be found at : https://src.springframework.org/svn/spring-samples/mvc-ajax/trunk/
I hope this helps.