<!-- jsp视图解析器-->
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass">
<value>org.springframework.web.servlet.view.InternalResourceView
</value>
</property>
<!-- 设置前缀,即视图所在的路径 -->
<property name="prefix" value="/jsp/" />
<!-- 设置后缀,即视图的扩展名 -->
<property name="suffix" value=".jsp" />
<!-- 排序,序号越小优先级越高-->
<property name="order" value="1" />
</bean>
<!-- freemaker视图解析器-->
<bean
class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="templateLoaderPath" value="/fm/" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<!-- freemarker视图解析器-->
<bean
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="suffix" value=".html" />
<property name="contentType" value="text/html;charset=UTF-8" />
<!-- 此变量值为pageContext.request,页面使用方法:rc.contextPath -->
<property name="requestContextAttribute" value="rc" />
<property name="order" value="2" />
</bean>