好久没做WEB开发,用SSM出现了:
The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler
原因是我之前只在方法前@RequestMapping,要在类前加@Controller才能被扫描得到
或者在spring-mvc.xml加上:
<!-- 扫描xxx包下所有使用注解的类型 -->
<context:component-scan base-package="com.soecode.lyy.xxxx" />
本文介绍了解决在Spring MVC中遇到的The DispatcherServlet configuration need to include a HandlerAdapter问题的方法。通过在类前添加@Controller注解或在spring-mvc.xml文件中配置<context:component-scan>来实现。
1455

被折叠的 条评论
为什么被折叠?



