从日志看Spring启动过程

[code="java"]
信息: Initializing Spring root WebApplicationContext
15:07:33,078 INFO ContextLoader:189 - Root WebApplicationContext: initialization started
15:07:33,109 INFO XmlWebApplicationContext:411 - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@18c56d: display name ; startup date [Wed Mar 02 15:07:33 CST 2011]; root of context hierarchy
15:07:33,156 INFO XmlBeanDefinitionReader:323 - Loading XML bean definitions from ServletContext resource [/WEB-INF/beans.xml]
15:07:33,390 INFO XmlBeanDefinitionReader:323 - Loading XML bean definitions from ServletContext resource [/WEB-INF/mail.xml]
15:07:33,406 INFO XmlWebApplicationContext:426 - Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@18c56d]: org.springframework.beans.factory.support.DefaultListableBeanFactory@15fc40c
15:07:33,500 INFO PropertyPlaceholderConfigurer:178 - Loading properties file from ServletContext resource [/WEB-INF/jdbc.properties]
15:07:33,500 INFO PropertyPlaceholderConfigurer:178 - Loading properties file from ServletContext resource [/WEB-INF/mail.properties]
15:07:33,562 INFO DefaultListableBeanFactory:414 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@15fc40c: defining beans [favoriteDao,messageDao,refCommentDao,referenceDao,refRequestDao,sequenceDao,userDao,daoSupport,facade,mailFactory,mailTask,mailTaskFactory,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,dataSource,txManager,sqlMapClient,sqlMapClientTmp,threadPool,cookieFilter,propertyConfigurer,mailSender,regMail,updateMail]; root of factory hierarchy
15:07:33,953 INFO ThreadPoolTaskExecutor:250 - Initializing ThreadPoolExecutor 'threadPool'
15:07:33,984 INFO ContextLoader:209 - Root WebApplicationContext: initialization completed in 906 ms
2011-3-2 15:07:34 org.apache.catalina.core.ApplicationContext log
[/code]



信息: Initializing Spring FrameworkServlet 'dispatcher'
15:07:34,015 INFO DispatcherServlet:277 - FrameworkServlet 'dispatcher': initialization started
15:07:34,015 INFO XmlWebApplicationContext:411 - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@16477d9: display name [WebApplicationContext for namespace 'dispatcher-servlet']; startup date [Wed Mar 02 15:07:34 CST 2011]; parent: org.springframework.web.context.support.XmlWebApplicationContext@18c56d
15:07:34,015 INFO XmlBeanDefinitionReader:323 - Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
15:07:34,046 INFO XmlWebApplicationContext:426 - Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@16477d9]: org.springframework.beans.factory.support.DefaultListableBeanFactory@c063ad
15:07:34,062 INFO DefaultListableBeanFactory:414 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@c063ad: defining beans [checkcodeController,userController,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,velocityConfig,viewResolver,multipartResolver]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@15fc40c
15:07:34,093 INFO VelocityConfigurer:222 - Loading Velocity config from [ServletContext resource [/WEB-INF/velocity.properties]]
15:07:34,109 INFO VelocityConfigurer:138 - ClasspathResourceLoader with name 'springMacro' added to configured VelocityEngine
15:07:34,375 INFO DispatcherServlet:296 - FrameworkServlet 'dispatcher': initialization completed in 360 ms
2011-3-2 15:07:34 org.apache.coyote.http11.Http11Protocol start


[color=red]注意两点:[/color]

[color=blue]1、Spring applicationContext先启动,servlet context后加载
2、dispatcher-servlet.xml中定义了控制器映射,使用Controller+RequestMapping注解映射时,相关controller组件扫描要定义在dispatcher-servlet.xml中,而非applicationContext.xml中。[/color]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值