zoukankan      html  css  js  c++  java
  • [springMvc]常见配置

    [springMvc]常见配置
    <?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:mvc="http://www.springframework.org/schema/mvc"
        xmlns:aop="http://www.springframework.org/schema/aop"
    	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-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/aop 
    		http://www.springframework.org/schema/aop/spring-aop.xsd">
    <!-- 配置自动扫描的包 -->		
    <context:component-scan base-package="com.booway.mhsy.*"></context:component-scan>
    <!-- 配置注解驱动 -->
    <mvc:annotation-driven>
    <!-- 配置json,支持json解析 -->
    <mvc:message-converters register-defaults="true">
    				<bean id="fastJacksonMessageConverter" class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
    					<property name="supportedMediaTypes">
    						<list>
    							<value>application/json;charset=UTF-8</value>
    						</list>
    					</property>
    					<property name="dateFormat" value="yyyy-MM-dd HH:mm:ss"></property>
    				</bean>
    			</mvc:message-converters>
    </mvc:annotation-driven>
    <!-- 配置视图解析器 -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name = "prefix" value="/WEB-INF/"></property>
    <property name = "suffix" value = ".jsp"></property>
    </bean>
    <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
    		<property name="order" value="1" />
     
    		<property name="defaultViews">
    			<list>
    				<!-- JSON View -->
    				<bean
    					class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">
    				</bean>
    			</list>
    		</property>
    	</bean>
    </beans>
    


    [springMvc]常见配置  

  • 相关阅读:
    【转】为什么要报考系统架构设计师考试
    前端三大主流框架中文文档
    零散知识点-类的区别;函数式编程的简单总结;
    window.location相关方法
    Hybrid相关
    php中file_get_contents与curl的区别
    三级下拉菜单
    微信生成带参数二维码及响应操作
    开发中因长时间不用而遗忘的,持续补充中。。
    项目中用到的几个工具函数
  • 原文地址:https://www.cnblogs.com/zyfBlogShare/p/11868509.html
Copyright © 2011-2022 走看看