日期:2014-05-18  浏览次数:20645 次

研究公司ssh项目Tomcat启动后,都干什么了
本帖最后由 aaameimei 于 2013-06-08 22:58:39 编辑
web.xml中的listerner

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

<listener>
<listener-class>
com.hollycrm.service.message.web.listener.CacheClearSessionListener
</listener-class>
</listener>
<listener>
<listener-class>
com.hollycrm.service.license.LimitClearSessionListener
</listener-class>
</listener>
<listener>
<listener-class>
com.hollycrm.service.system.security.web.listener.LogoutSessionListener
</listener-class>
</listener>
<!---->
<listener>
<listener-class>
com.hollycrm.service.license.PermissionStartupContextLoader
</listener-class>
</listener>
按照我理解思路是这几个listener执行完才轮到其他的执行。
第一个listerner应该是加载application.xml,
application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<!--http://www.springframework.org/dtd/
  - Application context definition for Petclinic on Hibernate.
-->
<beans>
<!-- ========================= GENERAL DEFINITIONS ========================= -->
<!-- Configurer that replaces ${...} placeholders with values from a properties file -->
<!-- (in this case, JDBC-related settings for the dataSource definition below) -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>/configure.properties</value>
<value>/global.properties</value>
<value>/plugins.properties</value>
</list>
</property>
</bean>
<!-- Message source for this context, loaded from localized "messages_xx" files -->
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename">
<value>messages</value>
</property>
</bean>
<!-- ========================= RESOURCE DEFINITIONS ========================= -->
<!-- Local DataSource that works in any environment -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>${jdbc.driverClassName}</value></property>
<property name="url"><value>${jdbc.url}</value></property>
<property name="username"><value>${jdbc.username}</value></property>
<property name="password"><value>${jdbc.password}</value></property>
</bean>

<!-- JNDI DataSource for J2EE environments -->
<!--
<bean id="dataSource" class="org.springframework.jnd