We are developing a Web application, in which we want to use Spring MVC Controllers and use RESTFUl Spring Controller. MVC Controllers are configured using wiring and NO Annotation is used, but we used ApplicationContext.xml
etc. However When we looked at the internet, we found there are many examples narrating how to develop RESTFUl Spring Controller using annotations.
Is it possible to develop RESTFUl Spring Controller without annotation. If yes then how to configure those into ApplicationCont开发者_StackOverflow中文版ext.xml
?
Yes you can implement Spring controllers without annotations, you just need to explicitly define each controller as a bean in your application context so that Spring can find them. For example:
<bean id="usersController" class="com.yourdomain.controller.UsersController"/>
See the Spring Documentation on configuring beans using XML for more information.
精彩评论