J'en ai besoin d'utiliser reservationBo et clientBo dans mon ma classe reservationWS mais il me donne une exception javanullpointerException parce qu ils ne sont pas déclarer mon reservationWSBean.
Comment je peux faire pour pouvoir les utiliser ?
Je veux ajouter d'autres property a reservationWS donne une autre exception exemple :
Code : 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 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- Configure spring to give a hook to axis2 without a ServletContext --> <bean id="applicationContext" class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder" /> <bean id="reservationWS" class="webservice.ReservationWS"> <property name="chambreBo" ref="chambreBo" /> </bean> <bean id="chambreBo" class="com.hotel.Bo.Impl.ChambreBoImpl" > <property name="chambreDAO" ref="chambreDAO" /> </bean> <bean id="chambreDAO" class="com.hotel.DAO.Impl.ChambreDAOImpl" > <property name="sessionFactory" ref="sessionFactory" /> </bean> </beans>
http://java.developpez.com/faq/sprin...#beaninjection
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <bean id="reservationWS" class="webservice.ReservationWS"> <property name="chambreBo" ref="chambreBo" /> <property name="reservationBo" ref="reservationBo" /> <property name="clientBo" ref="clientBo" /> </bean>
Ici ils ont montré comment injecter un Bean dans autre moi je veux plusieurs comme par exemple (mais ça ne marche pas).
Partager