je commence à developper une application web avec spring-hibernate-tapestry
les fichiers applicationcontext.xml et applicationcontextDao.xlm sont les suivant :
applicationcontext
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 <beans> <bean id="userManagerTarget" class="tuto.webssh.service.impl.UserManagerImpl"> <property name="userDao"> <ref bean="userDao" /> </property> </bean> <bean id="userManager" parent="transactionProxy"> <property name="transactionManager"> <ref bean="transactionManager"/> </property> <property name="target"> <ref bean="userManagerTarget"/> </property> <property name="transactionAttributeSource"> <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/> </property> </bean> </beans>
ApplicationcontextDao
------------------------------------------------------------
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 <beans> <!-- General --> <bean id="userDao" class="tuto.webssh.domain.dao.hibernate3.UserDaoImpl"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <!-- sessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property> <property name="configurationClass"> <value>org.hibernate.cfg.AnnotationConfiguration</value> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="transactionProxy" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="transactionManager"/> </property> <property name="transactionAttributes"> <props> <prop key="insert*">PROPAGATION_REQUIRED</prop> <propkey="update*">PROPAGATION_REQUIRED</prop> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION_REQUIRED, readOnly</prop> </props> </property> </bean> </beans>
j'utilise le bean userManager, dans une autre classe java, à l'aide des annotation @Inject @Service("userManager").
ma question est la suivante : j'ai créé un autre bean ClientManager, quesque je dois ajouter au niveau des fichier applicationcontext et applicationcontextdao pour pouvoir utiliser le bean clientManager.
Merci d'avance
Partager