springmvc注解驱动

<?xml version="1.0" encoding="UTF-8"?>

<beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans">



<context:component-scan base-package="cn.mengchenhui"/>
<!-- 注解驱动 -->
<mvc:annotation-driven/>
<!-- 视图解释器 -->

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property value="/WEB-INF/jsp/" name="prefix"/>
<property value=".jsp" name="suffix"/>
</bean>

</beans>

原文地址:https://www.cnblogs.com/mengchenhui/p/10610571.html