AI编程助手
AI免费问答

Spring的MVC配置

php中世界最好的语言   2018-03-07 16:48   1761浏览 原创

这次给大家带来spring的mvc配置,spring的mvc配置注意事项有哪些,下面就是实战案例,一起来看一下。

<?xml  version="1.0" encoding="UTF-8"?><beans>
    <!-- 默认的注解映射的支持 -->  
    <annotation-driven>
        <message-converters>  
            <bean>  
                <property></property>  
            </bean>  
        </message-converters> 
    </annotation-driven>
    <!-- 如果当前请求为“/”时,则转发到“/index” -->
    <view-controller></view-controller> 
    <!-- 静态资源映射 -->
    <resources></resources>
    <resources></resources>
    <resources></resources>
    <resources></resources>
    <resources></resources> 
    <!-- 当上面要访问的静态资源不包括在上面的配置中时,则根据此配置来访问 -->
    <default-servlet-handler></default-servlet-handler>
    <!-- 开启controller注解支持 -->
    <!-- use-default-filters="false" 只扫描指定的注解 -->
    <component-scan>
        <include-filter></include-filter>
    </component-scan> 
    <!-- 视图解析器 -->
    <bean>
       <property></property>
       <property></property>        
       <property></property>
       <property></property>
    </bean></beans>

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

相关阅读:

Hibernate的映射文件详解

使用Maven配置文件pom.xml

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。