码迷,mamicode.com
首页 > 编程语言 > 详细

spring mvc配置文件

时间:2015-07-31 01:28:24      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:/org/springframework/beans/factory/xml/spring-beans-3.2.xsd
                http://www.springframework.org/schema/context classpath:/org/springframework/context/config/spring-context-3.2.xsd
                http://www.springframework.org/schema/aop classpath:/org/springframework/aop/config/spring-aop-3.2.xsd
                http://www.springframework.org/schema/tx classpath:/org/springframework/transaction/config/spring-tx-3.2.xsd
                http://www.springframework.org/schema/mvc classpath:/org/springframework/web/servlet/config/spring-mvc-3.2.xsd">

    <mvc:annotation-driven/>    
    <!-- 配置control的扫描路径,只扫描com.hsj.controller路径下面的@Controller  -->
    <context:component-scan base-package="com.hsj.controller" />
    <!-- 对于资源文件直接映射 -->
    <mvc:resources location="/static/" mapping="/static/**"/>
    <!-- 配置注解的适配器类,默认选项有改适配器,不配置也可以使用注解进行开发 -->
    <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
    <!-- 配置视图解析器,有标准的jsp解析器,freemark视图解析器 -->
    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
        <property name="prefix"><value>/WEB-INF/page/</value></property>
        <property name="suffix"><value>.jsp</value></property>
    </bean>
</beans>



spring mvc配置文件

标签:

原文地址:http://blog.csdn.net/h249059945/article/details/47159923

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!