1、在类上加上注解@controller
@Controller
public class HelloController {
}
2、在配置文件中扫描
<!--扫描控制层组件-->
<context:component-scan base-package="com.atguigu.mvc.controller"></context:component-scan>
1、在类上加上注解@controller
@Controller
public class HelloController {
}
2、在配置文件中扫描
<!--扫描控制层组件-->
<context:component-scan base-package="com.atguigu.mvc.controller"></context:component-scan>
打赏作者