慕少森
springmvc的配置文件中对freemarker配置如下:<beanid="viewResolver"class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"><propertyname="viewClass"value="org.springframework.web.servlet.view.freemarker.FreeMarkerView"/><property name="suffix" value=".html" /><propertyname="contentType" value="text/html;charset=utf-8" /><propertyname="exposeRequestAttributes" value="true" /><propertyname="exposeSessionAttributes" value="true" /><propertyname="exposeSpringMacroHelpers" value="true" /><!--此变量值为pageContext.request, 页面使用方法:rc.contextPath --><propertyname="requestContextAttribute" value="rc" /></bean>是这样方式:${Session["user"]}