日期:2014-05-16 浏览次数:20465 次
<!-- Content Negotiating View Resolver --> <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> <property name="ignoreAcceptHeader" value="true" /> <property name="defaultContentType" value="text/html" /> <property name="mediaTypes"> <map> <entry key="html" value="text/html" /> <entry key="xml" value="application/xml" /> <entry key="json" value="application/json" /> </map> </property> <property name="favorParameter" value="false" /> <property name="viewResolvers"> <list> <bean class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"> <property name="cache" value="false" /> <property name="contentType" value="text/html" /> <property name="prefix" value="" /> <property name="suffix" value=".html.ftl" /> <property name="exposeSpringMacroHelpers" value="true" /> <property name="requestContextAttribute" value="rc" /> </bean> <bean class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"> <property name="cache" value="false" /> <property name="contentType" value="application/xml" /> <property name="prefix" value="" /> <property name="suffix" value=".xml.ftl" /> <property name="exposeSpringMacroHelpers" value="true" /> <property name="requestContextAttribute" value="rc" /> </bean> <bean class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"> <property name="cache" value="false" /> <property name="contentType" value="application/json" /> <property name="prefix" value="" /> <property name="suffix" value=".json.ftl" /> <property name="exposeSpringMacroHelpers" value="true" /> <property name="requestContextAttribute" value="rc" /> </bean> </list> </property> </bean>