在整合的freemarker代码如下
<property name="viewClass" value=" org.springframework.web.servlet.view.freemarker.FreeMarkerView"/>
<property name="contentType" value="text/html;charset=UTF-8"/>
<property name="cache" value="true"/>
<property name="suffix" value=".html" />
<property name="exposeRequestAttributes" value="true" />
<property name="exposeSessionAttributes" value="true" />
<property name="exposeSpringMacroHelpers" value="true" />
<!-- 把contextPath暴露给freemaker,前端可以通过${base.getContextPath()} 来获取上下文路径 -->
<property name="requestContextAttribute" value="base" />
<property name="allowSessionOverride" value="true"/>
在freemarker中使用base获取${base.getContextPath()}的时候,出现这个异常:
Caused by: javax.servlet.ServletException: Cannot expose request attribute 'base' because of an existing model object of the same name
请问下这个是什么问题?