SpEL使用功能

时间:2013-04-09 17:44:39

标签: spring spring-el

我添加到我的xml下一个bean:

<bean id="PracticeFactory" class="WordsLearning.PracticeFactory">
    <constructor-arg value="#{teacher.getPracticeType()}"/>
    <constructor-arg value="#{teacher.getAboutType()}"/>
</bean>

现在,当我运行应用程序时,它处于循环中:

INFO: Refreshing    org.springframework.context.support.ClassPathXmlApplicationContext@77a9aacd: startup date   [Tue Apr 09 20:35:47 EEST 2013]; root of context hierarchy
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [EntityOperatorBean.xml]
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
INFO: Overriding bean definition for bean 'stopTimer': replacing [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@b4599c9: defining beans [entityOperator,word,timer,English-Russian,teacher,steady,terse,saver,Keyboard input,Vival trusted,PracticeFactory,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.aop.aspectj.AspectJPointcutAdvisor#0,org.springframework.aop.aspectj.AspectJPointcutAdvisor#1,org.springframework.aop.aspectj.AspectJPointcutAdvisor#2,startTimer,stopTimer]; root of factory hierarchy
апр 09, 2013 8:35:47 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1c038a03: startup date [Tue Apr 09 20:35:47 EEST 2013]; root of context hierarchy
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [EntityOperatorBean.xml]
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
INFO: Overriding bean definition for bean 'stopTimer': replacing [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@24fbe4: defining beans [entityOperator,word,timer,English-Russian,teacher,steady,terse,saver,Keyboard input,Vival trusted,PracticeFactory,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.aop.aspectj.AspectJPointcutAdvisor#0,org.springframework.aop.aspectj.AspectJPointcutAdvisor#1,org.springframework.aop.aspectj.AspectJPointcutAdvisor#2,startTimer,stopTimer]; root of factory hierarchy
апр 09, 2013 8:35:47 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5b3a6eda: startup date [Tue Apr 09 20:35:47 EEST 2013]; root of context hierarchy
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [EntityOperatorBean.xml]
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
INFO: Overriding bean definition for bean 'stopTimer': replacing [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Root bean: class [org.springframework.aop.aspectj.AspectJExpressionPointcut]; scope=prototype; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1b9156ad: defining beans [entityOperator,word,timer,English-Russian,teacher,steady,terse,saver,Keyboard input,Vival trusted,PracticeFactory,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.aop.aspectj.AspectJPointcutAdvisor#0,org.springframework.aop.aspectj.AspectJPointcutAdvisor#1,org.springframework.aop.aspectj.AspectJPointcutAdvisor#2,startTimer,stopTimer]; root of factory hierarchy
апр 09, 2013 8:35:47 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@18c0364a: startup date [Tue Apr 09 20:35:47 EEST 2013]; root of context hierarchy
апр 09, 2013 8:35:47 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [EntityOperatorBean.xml]

没有那个bean,它的工作正确。

1 个答案:

答案 0 :(得分:0)

这是因为教师bean有“beans.xml”的请求和Factory bean请求“beans.xml”的价格,这是我的循环。