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

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -