Long time no programming, recently configured a SPRINGMVC project, the result controller has failed, any path is not intercept, vomit me ...
The result is that there is a problem with SPRINGMVC configuration, there are two configurations of SPRINGMVC:
One is:
1<Bean2 class= "Org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" >3<property name= "Messageconverters" >4<list>5<Bean6 class= "Org.springframework.http.converter.StringHttpMessageConverter" >7<property name= "Supportedmediatypes" >8<list>9<value>text/plain;charset=UTF-8</value>Ten</list> One</property> A</bean> -</list> -</property> the</bean>
This configuration method can prevent @responsebody return view garbled, so manually configure the bean, it cannot be used with <mvc:annotation-driven/>
Another type of:
1 <mvc:annotation-driven/>
Before the project I used the first method of configuration, the project can run normally, no error, but after changing a computer, will appear this article began to mention the problem.
The workaround is to configure it with the second method.
Why is this, I do not know.
Controller invalidation in spring MVC