liferay portal 5.23 tomcat 源码解析之监听器<1>

web程序的入口点是web.xml
从tomcat\webapps\ROOT\WEB-INF 下的web.xml 开始。
在web 程序启动前加载监听器,加载完成之后在去加载serlvet, filter。

<context-param>
<param-name>contextClass</param-name>
<param-value> com.liferay.portal.spring.context.PortalApplicationContext
</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</context-param>
<context-param>
<param-name>
com.ibm.websphere.portletcontainer.PortletDeploymentEnabled
</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>
com.sun.portal.container.service.PolicyService</param-name>
<param-value>
com.liferay.portal.portletcontainer.PolicyServiceImpl</param-value>
</context-param>
<listener>
<listener-class>
com.liferay.portal.spring.context.PortalContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
com.liferay.portal.servlet.PortalSessionListener</listener-class>
</listener>
<listener>
<listener-class>
com.liferay.portal.kernel.servlet.PortletSessionListenerManager
</listener-class>
</listener>
<listener>
<listener-class>
com.liferay.portal.kernel.servlet.SerializableSessionAttributeListener </listener-class>
</listener>
<listener>
<listener-class>
com.liferay.portal.servlet.SharedSessionAttributeListener
</listener-class>
</listener>
<listener>
<listener-class>
com.sun.portal.container.service.ServiceManagerContextListenerImpl
</listener-class>
</listener>
<listener>
<listener-class>
com.sun.portal.portletcontainer.impl.PortletContainerContextListenerImpl
</listener-class>
</listener>


监听器的执行顺序是从上之下开始执行的 。首先执行的是com.liferay.portal.spring.context.PortalContextLoaderListener
该类是 ContextLoaderListener 的子类。 ContextLoaderListener 是加载 spring 配置文件的一个监听类。该类就是用来加载spring 的配置文件。 在加载的同时会去调用 context-param 名为contextClass 的参数。并调用该参数配置的com.liferay.portal.spring.context.PortalApplicationContext class 的loadBeanDefinitions 方法。 该流程是spring 加载的相关流程。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值