• spring


    <?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 
            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/tx 
            http://www.springframework.org/schema/tx/spring-tx.xsd
            http://www.springframework.org/schema/aop 
            http://www.springframework.org/schema/aop/spring-aop.xsd
            http://www.springframework.org/schema/mvc 
            http://www.springframework.org/schema/mvc/spring-mvc.xsd
            ">
     
    
      <!-- 配置springmvc的组件  -->
      <context:component-scan base-package="cn.immoc">
    <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
    </context:component-scan>
    <!-- <mvc:resources location="/images/" mapping="/images/**"></mvc:resources>
    <mvc:resources location="/img/" mapping="/img/**"></mvc:resources> -->
    <mvc:resources location="/js/"    mapping="/js/**"></mvc:resources>
    <mvc:resources location="/style/" mapping="/style/**"></mvc:resources>
    
    <!-- http请求映射 -->
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
    <property name="cacheSeconds" value="0"/>
    <property name="messageConverters">
    <list>
    <ref bean="mappingJacksonHttpMessageConverter"/>
    <ref bean="mappingStringHttpMessageConverter"/>
    </list>
    </property>
    <property name="webBindingInitializer" ref="webBindingInitializer"/>
    </bean>
    <!-- 配置视图解析器 -->
    <bean class=" org.springframework.web.servlet.view.ContentNegotiatingViewResolver" id="viewResolver">
        <property name="ignoreAcceptHeader" value="true"></property>
        <property name="mediaType">
        <map>
            <entry key="json" value="application/json"></entry>
            <entry key="xml" value="application/xml"></entry>
        </map>
    </property>
    <property name="defaultContentType" value="text/html"/>
    <property name="favorParamter" value="false"/>
    <property name="viewResolvers">
    
    <list>
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="order" value="2"/>
    <property name="prefix" value="/WEB-INF/views"/>
    <property name="suffix" value=".jsp"/>
    </bean>
    </list>
    </property>
    </bean>
    </beans>
  • 相关阅读:
    HDOJ1251解题报告【字典树】
    HDOJ1305解题报告【字典树】
    HDOJ1087解题报告【动态规划】
    HDOJ1075解题报告【STL】
    HDOJ1172解题报告【暴力】
    ibatis 中调用存储过程
    后端开挂:3行代码写出8个接口!
    Go模拟浏览器登录操作代码
    Java架构师必须知道的 6 大设计原则
    easyUI时间戳转换(3种解决方法)
  • 原文地址:https://www.cnblogs.com/Hei-po/p/7019477.html
Copyright © 2020-2023  润新知