开发者

Mixing Annotated and Normal Controllers at Spring MVC 2.5

开发者 https://www.devze.com 2023-01-06 18:08 出处:网络
I just recently learned about spring mvc but the tutorials that I have seen uses concrete framwework controllers. (SimpleFormCOntroller/AbstractController..etc)

I just recently learned about spring mvc but the tutorials that I have seen uses concrete framwework controllers. (SimpleFormCOntroller/AbstractController..etc)

As I know, they were deprecated in Spring MVC 3.0 right now.

As I have been reading on the forum, they say that annotated controller are flexible than the one that extends spring classes. My question is, is it possible to mix both annotated and concrete controllers at one web appl开发者_如何学Pythonication context?

I only know how to use non-annotated style controller. But I think I want to learn the annotation based also. I need to add multiple form in one of my module and only annotated controller can handle this as per what they say.

I am afraid that I already have done some coding already and I dont want to rewrite those that are working already


Absolutely, you can mix them together as much as you want, no restrictions on that. It should just work.

DispatcherServlet has an automatically-defined list of HandlerMapping objects (which decide which requests go to which controllers), and HanderAdapter objects (which determine how the controllers are invoked). Both old-style and annotation-style controllers are supported out of the box, at the same time, in the same context.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号