springMVC-笔记001-mvc配置文件

来源:互联网 发布:魔龙诀时装进阶数据 编辑:程序博客网 时间:2024/06/08 09:03
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="        http://www.springframework.org/schema/beans        http://www.springframework.org/schema/beans/spring-beans.xsd        http://www.springframework.org/schema/context        http://www.springframework.org/schema/context/spring-context.xsd        http://www.springframework.org/schema/mvc        http://www.springframework.org/schema/mvc/spring-mvc.xsd"><!-- 配置注解 --><!-- <context:annotation-config /> --><!-- 组件扫描 --><context:component-scan base-package="com.mvc.controller"><!-- 扫描controller --><!-- 非只扫描controller,如base-package有service,可能造成事务失效 --><context:include-filter type="annotation"expression="org.springframework.stereotype.Controller" /></context:component-scan><!-- 启动mvc注解 --><mvc:annotation-driven /><!-- 静态资源放行 --><!-- <mvc:resources location="/resources/" mapping="/resources/**" /> --><!-- 配置视图解析器 --><bean id="jspViewResolver"class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="viewClass"value="org.springframework.web.servlet.view.JstlView" /><property name="prefix" value="/WEB-INF/jsp/" /><property name="suffix" value=".jsp" /></bean></beans>

原创粉丝点击