| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
10年前发布

SpringMVC多视图解释配置详解

spring mvc多视图解释,配置详解

    <?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:p="http://www.springframework.org/schema/p"            xmlns:context="http://www.springframework.org/schema/context"            xsi:schemaLocation="            http://www.springframework.org/schema/beans            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd            http://www.springframework.org/schema/context            http://www.springframework.org/schema/context/spring-context-3.0.xsd">            <context:component-scan                base-package="com.spring.action" />            <!--                  org.springframework.web.servlet.view.ResourceBundleViewResolver                用于多个视图集成时,ResourceBundleViewResolver是通过解析资源文件来解析请求输出文件的。                <property name="basename" value="views"></property>,即表示在/WEB-INF/classes路径下有一个                views.properties文件,本例中views.properties的内容为                welcome.(class)=org.springframework.web.servlet.view.velocity.VelocityView                welcome.url=welcome.vm                freemarker.(class)=org.springframework.web.servlet.view.freemarker.FreeMarkerView                freemarker.url=freemarker.ftl            -->            <bean class="org.springframework.web.servlet.view.ResourceBundleViewResolver">                <property name="basename" value="views"></property>                <!--                     <property name="order" value="0"></property>                -->            </bean>                        <!-- jsp视图解析器 -->            <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">                <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>                <property name="prefix" value="/"/>                <property name="suffix" value=".jsp"/>            </bean>                                <!-- velocity视图解析器 -->            <bean id="velocityViewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">                <property name="cache" value="true"/>                <property name="prefix" value="/"/>                <property name="suffix" value=".vm"/>            </bean>                        <!-- velocity环境配置 -->            <bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">                <!-- velocity配置文件路径 -->                <property name="configLocation" value="/WEB-INF/velocity.properties"/>                <!-- velocity模板路径 -->                <property name="resourceLoaderPath" value="/WEB-INF/velocity/"/>            </bean>                        <!-- FreeMarker环境配置 -->            <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">                <!-- freemarker模板位置 -->                <property name="templateLoaderPath" value="/WEB-INF/freemarker/"/>            </bean>                        <!-- FreeMarker视图解析 -->            <bean id="freeMarkerViewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">                <property name="cache" value="true"/>                <property name="prefix" value="/"/>                <property name="suffix" value=".ftl"/>            </bean>        </beans>  

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1398826283687.html
SpringMVC Spring MVC Web框架