35.2. Spring MVC Integration
RESTEasy can also integrate with the Spring
DispatcherServlet. This is advantageous because the web.xml is simpler, you can dispatch to either Spring controllers or RESTEasy from under the same base URL, and you can use Spring ModelAndView objects as return arguments from @GET resource methods. To set this up, you must use the Spring DispatcherServlet in your web.xml file, and import the springmvc-resteasy.xml file into your base Spring beans xml file. Here is an example web.xml file:
Then, within your main Spring beans xml file, import the
springmvc-resteasy.xml file.