How to use argument-resolvers using annotation in Spring boot? -
i use argument-resolvers
in spring boot. how go it? done in xml below.
<mvc:annotation-driven> <mvc:argument-resolvers> <bean class="nl.t42.spring31.validatingrequestbodymethodargumentresolver"/> </mvc:argument-resolvers> </mvc:annotation-driven>
see here
you can do:
@configuration @enablewebmvc public class webconfig extends webmvcconfigureradapter { @override public void addargumentresolvers(list<handlermethodargumentresolver> argumentresolvers) { // equivalent <mvc:argument-resolvers> } @override public void configuremessageconverters(list<httpmessageconverter<?>> converters) { // equivalent <mvc:message-converters> } }
@enablewebmvc
override boot defaults, may want skip it.
Comments
Post a Comment