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

SpringMVC基本配置

时间:2014-07-28 13:50:30      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   文件   io   html   div   

<?xml version="1.0" encoding="UTF-8"?>
<!-- SpringMVC配置文件 -->
<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-3.2.xsd
                        http://www.springframework.org/schema/context 
                        http://www.springframework.org/schema/context/spring-context-3.2.xsd
                        http://www.springframework.org/schema/mvc
                        http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
    
    <!-- SpringMVC注解扫描 -->
    <context:component-scan base-package="com.system.controller"></context:component-scan>
    
    <!-- 避免IE执行AJAX时,返回JSON出现下载文件 --> 
    <bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> 
        <property name="supportedMediaTypes"> 
            <list> 
                <value>text/html;charset=UTF-8</value> 
            </list> 
        </property> 
    </bean> 
    
    <mvc:annotation-driven/>
    
    <!-- SpringMVC视图解析 -->
    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/JSP/"/>
        <property name="suffix" value=".jsp"/>
    </bean>
    
</beans>

 

SpringMVC基本配置,布布扣,bubuko.com

SpringMVC基本配置

标签:style   blog   http   color   文件   io   html   div   

原文地址:http://www.cnblogs.com/jsczljh/p/3872420.html

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