2

i was working on the spring - mvc. and we were using AnnotationMethodHandlerAdapter bean declaration in *-servlet.xml file. As we were exploring Spring REST we came across ... is there any difference and which is better to use. Can someone answer please ?

1 Answer 1

2

The <mvc:annotation-driven /> tag registers, amongs other things, a AnnotationMethodHandlerAdapter or if you are on Spring 3.1+ a RequestMappingHandlerAdapter. It will register a whole lot more and saves you from explicitly defining all that beans. (If you are on Spring 3.1 or up I strongly urge you to remove the AnnotationMethodHandlerAdapter and to use the more powerful and flexible RequestMappingHandlerAdapter).

What is all registered and how to customize it is explained in the reference guide.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.