2 回答
TA贡献1798条经验 获得超3个赞
springmvc的配置文件中对freemarker配置如下:
<bean
id="viewResolver"
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property
name="viewClass"
TA贡献1873条经验 获得超9个赞
springmvc的配置文件中对freemarker配置如下:
<bean
id="viewResolver"
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property
name="viewClass"
value="org.springframework.web.servlet.view.freemarker.FreeMarkerView"
/>
<property name="suffix" value=".html" />
<property
name="contentType" value="text/html;charset=utf-8" />
<property
name="exposeRequestAttributes" value="true" />
<property
name="exposeSessionAttributes" value="true" />
<property
name="exposeSpringMacroHelpers" value="true" />
<!--
此变量值为pageContext.request, 页面使用方法:rc.contextPath -->
<property
name="requestContextAttribute" value="rc" />
</bean>
是这样方式:
${Session["user"]}
- 2 回答
- 0 关注
- 971 浏览
添加回答
举报