<!-- 保存项目路径 -->
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>projectPath</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.WebAppRootListener</listener-class>
</listener>
<!-- spring配置 结束 -->
注意点:该配置一定要放在spring启动监听器前。