分享

SpringMVC视图解析器:配置多个视图解析器的优先级

 翼ZYDREAM 2018-11-29
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www./schema/beans"
       xmlns:xsi="http://www./2001/XMLSchema-instance" xmlns:p="http://www./schema/p"
       xmlns:context="http://www./schema/context"
       xmlns:mvc="http://www./schema/mvc"
       xsi:schemaLocation="http://www./schema/beans
       http://www./schema/beans/spring-beans-3.0.xsd
       http://www./schema/context
       http://www./schema/context/spring-context-3.0.xsd http://www./schema/mvc http://www./schema/mvc/spring-mvc.xsd">
    <!-- 扫描web包,应用Spring的注解 -->
    <context:component-scan base-package="com.xxx.training"/>
    <bean class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
        <property name="basename">
            <value>spring-views</value>
        </property>
        <property name="order" value="0" />
    </bean>
    <bean class="org.springframework.web.servlet.view.XmlViewResolver">
        <property name="location">
            <value>/WEB-INF/spring-views.xml</value>
        </property>
        <property name="order" value="1" />
    </bean>
    <bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
        <property name="prefix">
            <value>/WEB-INF/pages/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
        <property name="order" value="2" />
    </bean>
</beans>

https://blog.csdn.net/wang1988081309/article/details/51895482

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约