Bonjour,
J'essaie de passer un bean en scope conversation mais ca ne marche pas, j'utilise orchestra.
Il s'agit d'un bean qui permet de faire une recherche, il met les resultats dans un de ces attribut qui est une liste, puis j'utilise ce bean pour afficher les resultat dans une page.
A priori, jamais il ne me sors d'erreur mais il ne m'affiche jamais les resultats la liste est montré comme vide dans la jsp mais avec le system.out je vois bien qu'elle est pourtant remplit.
J'imagine qu'il doit y avoir un probleme de conf quelque part, mais je ne sais pas ou c'est la première que j'utilise orchestra.
voici mes sources:
mon applicationContext.xml
Dans mon faces-config je ne met pas le bean puisqu'il apparait dans le applicationContext.xml, je ne sais pas si c'est comme ca qu'il faut faire mais si je le met dans le faces-conf il ne prend plus en compte celui dans applicationContext.xml.
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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <!-- 1. initialization of all orchestra modules (required for core15 module) --> <import resource="classpath*:/META-INF/spring-orchestra-init.xml" /> <!-- 2. the conversation scopes --> <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer"> <property name="scopes"> <map> <entry key="conversation.access"> <bean class="org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope"> <property name="lifetime" value="access"/> </bean> </entry> <entry key="conversation.manual"> <bean class="org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope"> <property name="lifetime" value="manual"/> </bean> </entry> </map> </property> </bean> <!-- les beans conversationnels --> <bean name="searchProjetsBean" class="frb.recherche.SearchProjetsBean" scope="conversation.access" autowire="byName"/> <bean name="projetBean" class="frb.recherche.ProjetBean" scope="conversation.access" autowire="byName"/> </beans>
Le début de la classe bean que j'utilise, (l'attribut listProjetsRecherches est ma liste)
mon bout de jsp:
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
21
22
23
24
25
26
27
28
29 @Controller @Scope( "conversation.access" ) public class SearchProjetsBean implements Serializable{ /** * */ private static final long serialVersionUID = 5934998506230795256L; private static Logger log4j = DBConnection.getLog4j(); private String projetId; private String acronyme; private String libelle; private String etOrOu; private ArrayList<String> typesProjet = new ArrayList<String>(); private ArrayList<String> statutsProjet = new ArrayList<String>(); private ArrayList<String> paysProjet = new ArrayList<String>(); private ArrayList<String> programmeProjet = new ArrayList<String>(); private ArrayList<String> zonesGeographiques = new ArrayList<String>(); private ArrayList<String> appelsAProjet = new ArrayList<String>(); private ArrayList<String> motsCles = new ArrayList<String>(); private ArrayList<ProjetBean> listProjetsRecherches= new ArrayList<ProjetBean>(); private ArrayList<ProjetBean> listProjetsRecherchesFRB= new ArrayList<ProjetBean>();//liste des projets en cours ou terminé private ProjetBean selectedProjet; private int nombreProjetsTrouves; private int nombreProjetsTrouvesFRB; .....
quand je passe le bean en scope session dans faces config ca marche, mais je veus avoir le bean en scope conversation
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <t:dataTable value="#{searchProjetsBean.listProjetsRecherches}" var="projet" rules="rows" width="915" rendered="#{compteBean.visibilite==3}"> <t:column width="60px;" > <f:facet name="header"> <h:outputText value="Id" /> </f:facet> <strong><h:outputText value="#{projet.projetId}" /></strong> </t:column> <t:column sortable="true" width="450px;"> <f:facet name="header"> <h:outputText value="Nom"/> </f:facet> <strong><h:outputText style='color:#0000A0' value="#{projet.libelle}" /></strong> </t:column> ...
Merci d'avance pour votre aide..![]()
Partager