zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    联想IdeaPad品牌出炉 三款笔记本亮相
    [推荐]2008年必不可少的20个网络产品
    微软公开.NET Base Classes源代码
    [共享一下]Head.First.设计模式.中文版
    IT: 蓝牙十岁了
    祝贺“阿来之家”博客正式开通~
    NodeJS安全设计:好吃的草莓味糖果,只给好朋友小红
    NodeJS文件读取:感恩常在抓把糖果,愉悦客人
    NodeJS缓存机制:畅销货,就多囤一点呗
    安装pygame出现is not a supported wheel on this platform解决办法
  • 原文地址:https://www.cnblogs.com/Hei-po/p/7019477.html
Copyright © 2011-2022 走看看