在模块项目下添加监听器:
在config目录下面添加web.xml文件,默认没有web.xml文件
文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:module="http://www.sgcc.com.cn/schema/platform/module"
xmlns:bizc="http://www.sgcc.com.cn/schema/platform/bizc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.sgcc.com.cn/schema/platform/module
http://www.sgcc.com.cn/schema/platform/module/module.xsd
http://www.sgcc.com.cn/schema/platform/bizc">
<!--初始化监听-->
<module:servletlistener id="ContextInit">
<module:listener-class>
com.nari.main.ContextInit
</module:listener-class>
</module:servletlistener>
</beans>