2 回答

TA貢獻(xiàn)1998條經(jīng)驗(yàn) 獲得超6個(gè)贊
springmvc的配置文件中對(duì)freemarker配置如下:
<bean
id="viewResolver"
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property
name="viewClass"

TA貢獻(xiàn)2019條經(jīng)驗(yàn) 獲得超9個(gè)贊
springmvc的配置文件中對(duì)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 關(guān)注
- 850 瀏覽
添加回答
舉報(bào)