我项目里加入spring插件
ServletContext context = ServletActionContext.getServletContext();这样就拿出不出来ServletContext了吗?
servletContext
我想在ServletContext里放全局的变量,我应该怎么保存到ServletContext里边
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml,
/WEB-INF/classes/applicationContext*.xml</param-value>
</context-param>
ServletContext context = ServletActionContext.getServletContext();这样就拿出不出来ServletContext了吗?
servletContext
我想在ServletContext里放全局的变量,我应该怎么保存到ServletContext里边
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml,
/WEB-INF/classes/applicationContext*.xml</param-value>
</context-param>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货