The purpose of this fork is to allow usage of Spring MVC annotations with RestyGWT instead of JAX-RS annotations. It is targeted to a Spring only environment where GWT is used just as the frontend. The backend is pure Spring MVC without any GWT dependencies (see the sample projects with-common-project and two-projects-only).
public interface DirectSpringMvcExampleService extends DirectRestService {
@RequestMapping(path = "/entities/{id}", method = GET)
EntityDto getExampleDtos(@PathVariable("id") String id);
@RequestMapping(path = "/entities", method = POST, consumes = {"application/json"})
EntityDto storeDto(EntityDto entity);
}
- WARNING
- It looks like Spring MVC annotations on method arguments must be placed both on the interface and on the implementation class (on the interface for RestyGWT and on the implementation for Spring itself).
- NOTE
- The easiest way to debug the Spring MVC extension is to add the property
<gwt.extraJvmArgs>-Xmx512m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1044</gwt.extraJvmArgs>
to the Maven POM and attach a remote debbuger to the execution of the GWT compiler when running with Maven. Thereby is the classRestAnnotationValueProvider
a good candidate for setting breakpoints because it contains the annotation abstraction over JAX-RS and Spring MVC. - NOTE
- In case of errors occuring during the GWT compilation the file generated by RestyGWT can be found and checked in
${project.build.directory}/.generated
.
To know more have a look to RestyGWT web site
RestyGWT is a GWT generator for REST services and JSON encoded data transfer objects.
- Generates Async Restful JSON based service proxies
- Java Object to JSON encoding/decoding
- Easy to use REST API