IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Struts 1 Java Discussion :

Cannot find bean under name


Sujet :

Struts 1 Java

  1. #1
    Membre confirmé Avatar de lextaz33
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2008
    Messages
    169
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2008
    Messages : 169
    Par défaut Cannot find bean under name
    Salut à tous.
    N'ayant pas trouvé ma réponse dans les précédents posts sur le sujet je post:

    Mon erreur est comme le titre l'indique "Cannot find bean under name" pour une collection d'un <html:options> dans une jsp.

    Voici les codes qui conviennent:

    Mon action:
    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
     
    List<Contact> listeContacts;
    List<Resultat> listeResultats;
    List<Nature> listeNatures;
    List<Affaire> listeAffaires;
     
    //ces deux listes sont toujours remplis ainsi
    listeNatures = natureBusiness.getAll();
    listeResultats = resultatBusiness.getAll();	
     
    //ces deux la sont remplis soit à vide comme ceci
    listeContacts = new ArrayList<Contact>();
    listeAffaires = new ArrayList<Affaire>();
    //soit comme ceci
    listeAffaires = affaireBusiness.getAllForContact(contactId);
    listeContacts = contactBusiness.getAllForAffaire(affaireId);
     
    //je fini mon action en envoyant les listes à ma page jsp
    request.setAttribute("listeContacts", listeContacts);
    request.setAttribute("listeNatures", listeNatures);
    request.setAttribute("listeResultats", listeResultats);
    request.setAttribute("listeAffaires", listeAffaires);
     
    //suivi du forward sur ma page
    return mapping.findForward(SUCCESS);
    Ma 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
     
    <html:select property="contact.contactid" styleId="comboContact" >
    	<html:options collection="listeContacts" property="contactid" labelProperty="contactnom" />
    </html:select>
     
    <html:select property="affaire.affaireid" >
    	<html:options collection="listeAffaires" property="affaireid" labelProperty="affairenom" />
    </html:select>
     
    <html:select property="nature.natureid">
    	<html:options collection="listeNatures" property="natureid" labelProperty="naturenom" />
    </html:select>
     
    <html:select property="resultat.resultatid">
    	<html:options collection="listeResultats" property="resultatid" labelProperty="resultatnom" />
    </html:select>
    struts-config:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    <action path="/evenement" name="evenementForm"
    	parameter="dispatch" scope="session" validate="false"
    	type="com.infotel.grc.action.EvenementAction" >
    	<forward name="success" path=".evenement.info"/>
    	<forward name="notIdentified" path=".login" redirect="false" />
    	<forward name="evenements" path=".evenement" />
    </action>
    Voila l'erreur vient de listeContacts uniquement.
    Je vous ai mis toutes mes listes pour que vous voyez. J'ai seulement la listeContacts qui me fait cet erreur et le pire, c'est qu'elle est bien rempli et qu'elle s'affiche bien dans ma combo box et mon appli continue à tourner sans problème. Aucune erreur dans l'action rien...

    Pour finir voici la trace:
    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
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
     
    ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Cannot find bean under name listeAffaires
    	at org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:377)
    	at org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:188)
    	at org.apache.jsp.page.detailsEvenement_jsp._jspx_meth_html_options_1(detailsEvenement_jsp.java:1048)
    	at org.apache.jsp.page.detailsEvenement_jsp._jspx_meth_html_select_1(detailsEvenement_jsp.java:1016)
    	at org.apache.jsp.page.detailsEvenement_jsp._jspx_meth_logic_notPresent_0(detailsEvenement_jsp.java:980)
    	at org.apache.jsp.page.detailsEvenement_jsp._jspService(detailsEvenement_jsp.java:364)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    	at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:631)
    	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:625)
    	at sun.reflect.GeneratedMethodAccessor1385.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:129)
    	at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:152)
    	at org.apache.struts.tiles.taglib.InsertTag.doInclude(InsertTag.java:764)
    	at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:896)
    	at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
    	at org.apache.jsp.layout_main_jsp._jspx_meth_tile_insert_3(layout_main_jsp.java:241)
    	at org.apache.jsp.layout_main_jsp._jspService(layout_main_jsp.java:139)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    	at org.apache.struts.action.RequestProcessor.doInclude(RequestProcessor.java:1105)
    	at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:292)
    	at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:271)
    	at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:332)
    	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)
    	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    	at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    	at java.lang.Thread.run(Unknown Source)
    15:19:44,627 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Cannot find bean under name listeAffaires
    	at org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:377)
    	at org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:188)
    	at org.apache.jsp.page.detailsEvenement_jsp._jspx_meth_html_options_1(detailsEvenement_jsp.java:1048)
    	at org.apache.jsp.page.detailsEvenement_jsp._jspx_meth_html_select_1(detailsEvenement_jsp.java:1016)
    	at org.apache.jsp.page.detailsEvenement_jsp._jspx_meth_logic_notPresent_0(detailsEvenement_jsp.java:980)
    	at org.apache.jsp.page.detailsEvenement_jsp._jspService(detailsEvenement_jsp.java:364)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:602)
    	at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:138)
    	at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:152)
    	at org.apache.struts.tiles.taglib.InsertTag.doInclude(InsertTag.java:764)
    	at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:896)
    	at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
    	at org.apache.jsp.layout_main_jsp._jspx_meth_tile_insert_3(layout_main_jsp.java:241)
    	at org.apache.jsp.layout_main_jsp._jspService(layout_main_jsp.java:139)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    	at org.apache.struts.action.RequestProcessor.doInclude(RequestProcessor.java:1105)
    	at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:292)
    	at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:271)
    	at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:332)
    	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)
    	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    	at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    	at java.lang.Thread.run(Unknown Source)
    15:19:44,642 ERROR [InsertTag] ServletException in '/page/detailsEvenement.jsp': Cannot find bean under name listeAffaires
    org.apache.jasper.JasperException: Cannot find bean under name listeAffaires
    	at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:602)
    	at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:138)
    	at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:152)
    	at org.apache.struts.tiles.taglib.InsertTag.doInclude(InsertTag.java:764)
    	at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:896)
    	at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
    	at org.apache.jsp.layout_main_jsp._jspx_meth_tile_insert_3(layout_main_jsp.java:241)
    	at org.apache.jsp.layout_main_jsp._jspService(layout_main_jsp.java:139)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    	at org.apache.struts.action.RequestProcessor.doInclude(RequestProcessor.java:1105)
    	at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:292)
    	at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:271)
    	at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:332)
    	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)
    	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    	at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    	at java.lang.Thread.run(Unknown Source)
    Merci d'avance!

  2. #2
    Membre émérite
    Profil pro
    Développeur Back-End
    Inscrit en
    Avril 2003
    Messages
    782
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Back-End

    Informations forums :
    Inscription : Avril 2003
    Messages : 782
    Par défaut
    Bonjour,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    javax.servlet.jsp.JspException: Cannot find bean under name listeAffaires
    D'après le message le problème est plutôt "listeAffaires".
    est-ce que "affaireBusiness.getAllForContact(contactId)" ne renverrai pas null ?

  3. #3
    Membre confirmé Avatar de lextaz33
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2008
    Messages
    169
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2008
    Messages : 169
    Par défaut
    oui pardon listeAffaires.
    J'ai confondu parcueque ce sont les deux seuls liste que je modifie au fur et à mesure.

    Mais ça ne change rien comme je disai, ces listes ne sont pas null

    (en faisant un sysout ça m'affiche bien une liste comme ceci [com.infotel.grc.model.Affaire@910424]
    [com.infotel.grc.model.Contact@a6fec1])

    et mes combo box sont bien remplis.!

  4. #4
    Membre confirmé Avatar de lextaz33
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2008
    Messages
    169
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2008
    Messages : 169
    Par défaut
    Après recherche je précise un peu l'origine de l'erreur.
    j'ai un champ suggest dans cette page qui lorsque je tape une lettre exécute une action autre que celle du formulaire ou je me trouve.

    je m'explique:
    je tape une lettre, je fait suggest.do, une liste de suggestion s'affiche et quand je sélectionne, je fais un evenement.do (qui est l'action originale du formulaire)
    pour initialiser mes combo.

    Je pense que c'est la l'erreur, je ne me trouve plus dans le bon scope ou koi.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    <action path="/evenement" name="evenementForm"
    	parameter="dispatch" scope="session" validate="false"
    	type="com.infotel.grc.action.EvenementAction" >
    	<forward name="success" path=".evenement.info"/>
    	<forward name="notIdentified" path=".login" redirect="false" />
    	<forward name="evenements" path=".evenement" />
    </action>
     
    <action path="/suggest" type="com.infotel.grc.action.SuggestAction"  parameter="dispatch" scope="session">
            <forward name="evenement" path=".evenement.info" />  
            <forward name="notIdentified" path=".login" redirect="false" />       
    </action>

  5. #5
    Membre confirmé Avatar de lextaz33
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2008
    Messages
    169
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2008
    Messages : 169
    Par défaut
    Bon je vai faire plus simple:

    Est-ce que le fait d'exécuter une action "actionX" dans un formulaire "formY" (l'action de ce formulaire étant "actionY"), peut poser des problèmes sur les propriétés de "formY" et "actionY"????

    Précisément, j'exécute à un moment donné l'action "suggest.do" dans le formulaire "evenementForm" qui a pour action "evenement.do".

    A ce moment, je ne valide pas le formulaire, je met juste des valeurs à jours et après, une valeur initialiser dans evenement.do n'est pas trouvé comme le dit le titre du post.

  6. #6
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Si tu exécutes une nouvelle Action, tu envoies une nouvelle requête.
    Tu perds donc tous les objets stockés dans le scope request.
    En mettant les collections dans le scope session, tu ne devrais plus avoir de problèmes.

  7. #7
    Membre confirmé Avatar de lextaz33
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2008
    Messages
    169
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2008
    Messages : 169
    Par défaut
    Comme tu peut le voir sur mes posts précédents, les actions sont bien en session, et mes collections malgré le fait que le trace me dise qu'il ne les trouve pas s'affiche bien correctement.

    l'appel à l'action suggest se fait de cette manière:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    var _adresseRecherche = "suggest.do?dispatch=doGet&"
    _xmlHttp.open("GET",_adresseRecherche+"debut="+valeur+"&type=cont",true);
    Peut-être que cela peut t'aider.
    sinon j'ai essayé de faire
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    request.getSession().setAttribute("listeAffaires", listeAffaires);
    au lieu de
    request.setAttribute("listeAffaires", listeAffaires);
    mais c'est pareil...
    Que faire??

  8. #8
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Citation Envoyé par lextaz33 Voir le message
    Comme tu peut le voir sur mes posts précédents, les actions sont bien en session, et mes collections malgré le fait que le trace me dise qu'il ne les trouve pas s'affiche bien correctement.
    Dans mon message, je te demandais de faire un test en mettant les collections en session.
    A aucun moment, je n'ai parlé d'actions en session.
    D'ailleurs, pour info, quand tu précises scope="session" dans le mapping d'une Action, c'est pour lui dire de mettre le form-bean lié à cette Action en session.
    Donc, dans le mapping d'une Action sans form-bean, l'attribut scope="session" n'a pas lieu d'être.

    En fait, si tu affiches ta page jsp avant de soumettre l'Action qui met les collections dans le scope, il est normal que tu aies ce message d'erreur.

    Tu devrais peut-être ajouter un tag logic:present :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <logic:present name="listeAffaires">
       <html:select property="affaire.affaireid" >
    	<html:options collection="listeAffaires" property="affaireid" labelProperty="affairenom" />
       </html:select>
    </logic:present>
    sans oublier d'ajouter au début de la jsp la directive taglib qui pointe sur la tld des tags logic.

  9. #9
    Membre confirmé Avatar de lextaz33
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2008
    Messages
    169
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2008
    Messages : 169
    Par défaut
    D'accord!
    Alors j'ai fait
    request.getSession().setAttribute("listeAffaires", listeAffaires);

    est-ce que c'est ca pour mettre ma collection en session?

  10. #10
    Membre émérite
    Profil pro
    Développeur Back-End
    Inscrit en
    Avril 2003
    Messages
    782
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Back-End

    Informations forums :
    Inscription : Avril 2003
    Messages : 782
    Par défaut
    oui

  11. #11
    Membre confirmé Avatar de lextaz33
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2008
    Messages
    169
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2008
    Messages : 169
    Par défaut
    Parfait!
    Merci à toi c_nvy!!

    Je me souviendrai d'utiliser request.getSession().

    Je précise qu'il faut que je mette le tag <logic:present name="maliste"></logic:present> sinon l'erreur est toujours la même avec le getSession()!

    bref ça fonctionne merci encore!
    RESOLU!

  12. #12
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Dans ce cas, laisse les collections dans le scope request et ajoute le tag logic:present pour chacune des tes listes déroulantes.

  13. #13
    Membre confirmé Avatar de lextaz33
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2008
    Messages
    169
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2008
    Messages : 169
    Par défaut
    Very Good, ça marche aussi!
    Merci!

  14. #14
    Membre averti
    Inscrit en
    Février 2009
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 32
    Par défaut
    Bonjour;

    J'ai le même problème que celui ci-dessus;
    J'ai fait la même démarche, ma page jsp s'affiche mais les combo(<select...) s'affiche pas !!!


    voici l'action :


    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
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    
    package com.wana.mvc.controller;
    
    import java.util.ResourceBundle;
    
    import java.util.ArrayList;
    
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.sql.DataSource;
    import org.apache.commons.dbcp.BasicDataSource;
    
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    
    import org.apache.log4j.Category;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    
    import com.wana.mvc.model.bo.OperateurBean;
    import com.wana.mvc.model.bo.PaysBean;
    import com.wana.mvc.model.bo.CercleBean;
    import com.wana.mvc.model.bo.CommBean;
    import com.wana.mvc.model.bo.LocBean;
    import com.wana.mvc.view.CommForm;
    //import com.wana.security.User;
    import com.wana.servlet.WanaServlet;
    
    public final class RechercheLocalisationPage1Action extends Action {
    
    static Category LOG = Category.getInstance(RechercheLocalisationPage1Action.class.getName());
    
    public ActionForward execute(
    ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    
    
    LOG.debug("Acces à l'action de la premiere page de la reherche");
    
    
    DataSource dataSource = null;
    Connection connection = null;
    try {
    		dataSource = (DataSource)servlet.getServletContext().getAttribute("org.apache.struts.action.DATA_SOURCE");
            connection = dataSource.getConnection();
            String requete = "select DESC_CERC, IDNT_CERC from cercle where (desc_cerc != 'Inconnu') order by desc_cerc";
    							  
    		Statement statement = connection.createStatement();
    		 
    		if (LOG.isDebugEnabled())
    			LOG.debug("requete envoyee n°1 : " + requete);
    
    			ResultSet resultSet = statement.executeQuery(requete);
    			ArrayList listeCerclesloc = new ArrayList();
    			while(resultSet.next()) {			
    		 
    				LocBean cerclebeanloc = new LocBean();
    				cerclebeanloc.setNomCercleloc(resultSet.getString("DESC_CERC"));
    				cerclebeanloc.setIdentCercleloc(resultSet.getString("IDNT_CERC"));
    				listeCerclesloc.add(cerclebeanloc);
                      }
                      resultSet.getStatement().close();
                      resultSet.close();
    				  
    				  
    				requete = "select distinct pays_dest from OPRT_PAYS_DEST order by pays_dest";
    				LOG.debug("requete envoyee n°2 : " + requete);
    				statement = connection.createStatement();
    				resultSet = statement.executeQuery(requete);
    				ArrayList listePaysloc = new ArrayList();
    				while(resultSet.next()) {			
    				LocBean paysbeanloc = new LocBean(); 
    				paysbeanloc.setNomPaysloc(resultSet.getString("pays_dest"));
    				listePaysloc.add(paysbeanloc);
                      }
                      resultSet.getStatement().close();
                      resultSet.close();
    				  
    				  
    				// Rafraichissement de la page en fonction du pays choisi
    
    				//String numAppel = request.getParameter("numappel");
    				//String numSerie = request.getParameter("numserie");
    				//String cellule = request.getParameter("nomCercle");
    				//String numAutreOperateur = request.getParameter("numautreop");
    				//String periodeDebut = request.getParameter("periodedu");
    				//String periodeFin = request.getParameter("au");
    				//String typeTrafic = request.getParameter("typetrafic");
    				//String directionAppel= request.getParameter("directionappel");
    			String paysDestination_loc = request.getParameter("nomPaysloc");
    				//String opDestination = request.getParameter("nomOperateur");
    				//String imei = request.getParameter("imei");
    				  
    				  
    			requete = "select distinct OPRT_DEST from OPRT_PAYS_DEST where pays_dest='"+paysDestination_loc+"' order by OPRT_DEST";
    			//	requete = "select distinct OPRT_DEST from OPRT_PAYS_DEST ";
    				LOG.debug("requete envoyee n°3 : " + requete);
    				statement = connection.createStatement();
    				resultSet = statement.executeQuery(requete);
    				ArrayList listeOperateursloc = new ArrayList();
    				while(resultSet.next()) {			
    				LocBean operateurbeanloc = new LocBean(); 
    				operateurbeanloc.setNomOperateurloc(resultSet.getString("OPRT_DEST"));
    				listeOperateursloc.add(operateurbeanloc);
                      }
                      resultSet.getStatement().close();
                      resultSet.close();
    				  
                      connection.close();
                      
    					request.getSession().setAttribute("listeCerclesloc", listeCerclesloc );
    					request.getSession().setAttribute("listePaysloc", listePaysloc );
    					request.getSession().setAttribute("listeOperateursloc", listeOperateursloc );
    										
    					return mapping.findForward("continueloc");
    					}
    					catch (SQLException e1) {
    					LOG.error("Erreur Oracle: ",e1);
    					return mapping.findForward("affichagePageErreur") ;
                    }
    }
    }
    
    
    
    
    
    
    
    
    


    et vois l'actionForm :
    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
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    
    package com.wana.mvc.model.bo;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import javax.servlet.http.HttpServletRequest;
    
    import org.apache.log4j.Category;
    
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionMessage;
    
    
    public class LocBean extends ActionForm {
    
      private String identCercleloc;
    	private String nomCercleloc;
    	private String nomPaysloc;
    	private String nomOperateurloc;
    	private String identOperateurloc;
    	
    	
    	static Category LOG = Category.getInstance(LocBean.class.getName());
    	
    	public LocBean() {
    		
    		 identCercleloc="";
    		  nomCercleloc="";
    		  nomPaysloc="";
    		  nomOperateurloc="";
    		  identOperateurloc="";
    		
    	}
    	
    	
    	public void reset(ActionMapping mapping, HttpServletRequest request) {
      
      identCercleloc="";
    	 nomCercleloc="";
    	 nomPaysloc="";
    	 nomOperateurloc="";
       identOperateurloc="";
      
      }
    	
    
    	
    	
    	
    	public String getIdentCercleloc() {
    		return identCercleloc;
    	}
    	public void setIdentCercleloc(String identCercleloc) {
    		this.identCercleloc = identCercleloc;
    	}
    	public String getNomCercleloc() {
    		return nomCercleloc;
    	}
    	public void setNomCercleloc(String nomCercleloc) {
    		this.nomCercleloc = nomCercleloc;
    	}
    	public String getNomPaysloc() {
    		return nomPaysloc;
    	}
    	public void setNomPaysloc(String nomPaysloc) {
    		this.nomPaysloc = nomPaysloc;
    	}
    	public String getNomOperateurloc() {
    		return nomOperateurloc;
    	}
    	public void setNomOperateurloc(String nomOperateurloc) {
    		this.nomOperateurloc = nomOperateurloc;
    	}
    	public String getIdentOperateurloc() {
    		return identOperateurloc;
    	}
    	public void setIdentOperateurloc(String identOperateurloc) {
    		this.identOperateurloc = identOperateurloc;
    	}
    	
    
    }
    
    
    


    et voic lapage 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
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-layout.tld" prefix="layout" %>
    
    
    
    <html:html>
    
    
    
    <HEAD>
    	<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
    	<TITLE><bean:message key="all.jsp.title.wana"/></TITLE>
    	<LINK REL="STYLESHEET" TYPE="text/css" HREF="styles/style.css">
    	<layout:skin/>
    	<script src="js/controle.js"></script>
        <script src="config/javascript.js"></script>
        
    	
    </HEAD>
    
    
    
    <BODY BGCOLOR="white" TOPMARGIN=0 LEFTMARGIN="0" BOTTOMMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" RIGHTMARGIN="0"><BR>
    
    
    
    
    <TABLE WIDTH="760" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="center" BGCOLOR="white" height="1">
    <TR>
    	<TD WIDTH="760" COLSPAN="3" BGCOLOR="#999999" height="3"><IMG SRC="images/vide.gif" WIDTH="1" HEIGHT="1" ALT="" BORDER="0"></TD>
    </TR>
    
    <TR>
    	<TD WIDTH="1" BGCOLOR="#999999" height="220"><IMG SRC="images/vide.gif" WIDTH="1" HEIGHT="1" ALT="" BORDER="0"></TD>
    	<TD WIDTH="758" height="220">  
     		<img border="0" alt="accueil" src="images/logo_mco.gif" height="56">
          	<p  align="center"class="titrerouge12" align="center"> <bean:message key="rechercheLocalisation.jsp.subtitle.recherche"/></p>
          <p><BR></p>
            
    
     	<TABLE WIDTH="758" BORDER="0" CELLSPACING="0" CELLPADDING="0"  height="379">
    	<TR>
    
    		<TD WIDTH="1" BGCOLOR="#999999" height="379"><IMG SRC="images/vide.gif" WIDTH="1" HEIGHT="1" ALT="" BORDER="0"></TD>
    		<TD WIDTH="1" height="379"><IMG SRC="images/vide.gif" WIDTH="1" HEIGHT="1" ALT="" BORDER="0"></TD>
    		<TD WIDTH="626" VALIGN="top" height="379">
    		            	
    						
    	<TABLE WIDTH="758" BORDER="0" CELLSPACING="0" CELLPADDING="0"  height="200">
    	
    	<html:form method="get" action="/resultatRechercheLocalisation.do"  >
    	
    	<p align="right" class="titrenoir11">* Champ obligatoire</p>
    	
    	
    	
    	
    	
    	
    	<TR>
    		<TH align="right" class="txtgris11">Par cercle   :</TH>
    		<TD> 
    		
    		 <logic:present name="listeCerclesloc">
    		
    		<html:select property="nomCercleloc" 
    				<html:option value="Tous"></html:option>
    				<html:options collection="listeCerclesloc" property="identCercleloc" labelProperty="nomCercleloc" /> 
    		</html:select>
    	
     
      	</logic:present>
    		
    		
    		</TD>
     
    
    		<TH align="right" class="txtgris11">Pays destination   :</TH>
    		<TD> 
    		
    		
    	<logic:present name="listePaysloc">
    		<html:select property="nomPaysloc" onchange="form.action='rechercheLocalisation.do';form.submit();">
    				<html:option value="Tous"></html:option>
    				<html:options collection="listePaysloc" property="nomPaysloc" labelProperty="nomPaysloc" /> 
    		</html:select>
    		</logic:present>
    		
    		</TD>
    		
    	</TR>
    
    	<TR>
    		
    		
    		<TH align="right" class="txtgris11">Op. destination   :</TH>
    		<TD> 
    		
    		
        <logic:present name="listeOperateursloc">
    		<html:select property="nomOperateurloc" >
    				<html:option value="Tous"></html:option>
    				<html:options collection="listeOperateursloc" property="nomOperateurloc" labelProperty="nomOperateurloc" /> 
    		</html:select>
    	</logic:present>
    		
    		</TD>
    		
    
    	</TR>
    	
    	
    	
    	
    	
    
    	
    	
    	</TABLE> 
    		
    		
    	     <center>
    					
                		<html:image property="submit" title="Valider" alt="Valider" src="images/valider.gif" />
    	     </center>
    		 
    		 
    	     </html:form>
    
    		 
    		 <form action="accueil.jsp">
    		  <center>
    					
                		<html:image property="cancel" title="Retour" alt="Retour" src="images/retour.gif" />
    	     </center>
    		 </form>
    		 
    		 
    		 <html:form action="deconnexionWana.do" method="post">
    			<center>			
    			<html:image property="submit" title="Quitter" alt="Quitter" src="images/quitter.gif" />
    			</center>
    		</html:form>
    		 
    		 
    <%-- pied de page--%>
    			
    
              </TD>
    		  <TD WIDTH="1" VALIGN="top" height="379"><BR>
              </TD>
    		  <TD WIDTH="2" height="379"></TD>
    	</TR>
    	</TABLE>
    
    	</TD>
    	<TD WIDTH="1" BGCOLOR="#999999" height="220"><IMG SRC="images/vide.gif" WIDTH="1" HEIGHT="1" ALT="" BORDER="0"></TD>
    </TR>
    
    <TR>
    	<TD WIDTH="760" COLSPAN="3" BGCOLOR="#999999" height="1"><IMG SRC="images/vide.gif" WIDTH="1" HEIGHT="1" ALT="" BORDER="0"></TD>
    </TR>
    </TABLE>
    
    
    
    
    </BODY>
    </html:html>
    
    
    Merci !!!

  15. #15
    Membre averti
    Inscrit en
    Février 2009
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 32
    Par défaut
    Re-Bonjour;

    Quand je fais

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    <html:select property="nomCercleloc"  >
    			<html:option value="Tous"></html:option>
     <html:options collection="listeCerclesloc" property="identCercleloc" labelProperty="nomCercleloc" /> 
    		</html:select>
    J’obtiens l’erreur suivante :
    cannot find bean under name nomCercleloc

    Et quand j’ajoute <logic:present name="listeCerclesloc"> </logic:present> la liste s’affiche pas à l’écran

    Je ne sais pas d’où vient le souci

    cdt

  16. #16
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    As-tu défini la propriété nomCercleloc dans l'ActionForm ?

    D'après le code que tu as posté, la liste s'appelle listeCercles et non listeCerclesloc et les propriétés de l'objet CercleBean sont nomCercle et identCercle.
    Il faut donc modifier le select en conséquence.

  17. #17
    Membre averti
    Inscrit en
    Février 2009
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 32
    Par défaut
    Bonjour;

    PARDON !!!, Merci de prendre en considération les rectifications dans le code ci-dessus
    L’erreur est toujours la même.
    Quand je supprime le tag <logic:present .... je reçois l'erreur "canot fin bean under name.." et quand je l'ajoute les trois listes s'affichent pas sur l'interface ;
    Merci de m'aider à corriger le souci le plus tot poussible, il me reste 3 jours pour livrer ça !!

  18. #18
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Mais le message d'erreur, est-ce
    cannot find bean under name nomCercleloc
    ou
    cannot find bean under name listeCerclesloc
    ?

    L'Action RechercheLocalisationPage1Action est-elle bien exécutée avant la jsp ?

  19. #19
    Membre averti
    Inscrit en
    Février 2009
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 32
    Par défaut
    Bonjour ;

    Le message d'erreur est

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    javax.servlet.ServletException: Cannot find bean under name listeCerclesloc
    
    Comment je peux savoir si l'action "rechercheLocalisationPage1" est bien exécuté avant la JSP ?

    Priere être avec moi afin que je puisse corriger ce souci

    cdt

  20. #20
    Membre averti
    Inscrit en
    Février 2009
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 32
    Par défaut
    J'ai fait aussi un petit exemple en utilisant Hibernate ,aussi ça marche pas voici ce que j'ai fait :


    Le mapping de Cercle :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
    	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping package="Dao">
      <class name="Cercle">
      <id name="idVille" column="ID">
      <generator class="native"></generator>
      </id>
     
      <property name="ville" column="VILLE"></property>
      </class>
    </hibernate-mapping>
    L'Action :

    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
    package Web;
     
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
     
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
     
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
     
    import Dao.Cercle;
    import Dao.Metier;
     
    public class CercleAction extends Action {
     
     
    	@Override
    	public ActionForward execute(ActionMapping mapping, ActionForm form,
    			HttpServletRequest request, HttpServletResponse response)
    			throws Exception {
     
    		Metier m=new Metier();
    		CercleForm f=(CercleForm) form;
    		ArrayList maliste=new ArrayList();
     
    		Iterator<Cercle> it=m.getVilleList().iterator();
     
    		while(it.hasNext()){
     
    			Cercle c=it.next();
    			f.setVille(c.getVille());
    			maliste.add(f);
    		}
     
    		request.getSession().setAttribute("maliste", maliste);
    		return mapping.findForward("vueCercles");
    	}
     
    }


    La Méthode getVilleList(){:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    public List getVilleList(){
    		Session session=HibernateUtil.getSessionFactory().getCurrentSession();
    		session.beginTransaction();
    		Criteria cri=session.createCriteria(Cercle.class);
    		return cri.list();
    	}
    Le form bean :



    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
    package Web;
     
    import org.apache.struts.action.ActionForm;
     
    public class CercleForm extends ActionForm {
     
    	private String ville;
     
    	public String getVille() {
    		return ville;
    	}
     
    	public void setVille(String ville) {
    		this.ville = ville;
    	}
     
     
     
    }

    La 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
    30
    31
    32
    33
    34
    35
    36
    37
    38
    <%@taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
    <%@taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
    <%@taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
     
    <html>
    <head>
    <title>Combo</title>
    </head>
    <body>
    	<html:form method="get" action="/combo.do"  >
     
    <table border="1" width="80%">
     
     
    <TH align="right" class="txtgris11"> liste   :</TH>
     
    <TD>
     
    <logic:present name="maliste" >
     
    <html:select property="ville" >
    <html:options collection="maliste" property="ville" labelProperty="ville"/>
    </html:select>
     
    </logic:present>
     
    </TD>
     
     
     
    </table>
     
    </html:form>
     
    </body>
     
     
    </html>
    Struts-config :
    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
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
    <struts-config>
     
     
       <form-beans>
       <form-bean name="pf" type="Web.ProduitForm"></form-bean>
       <form-bean name="f" type="Web.CercleForm"></form-bean>
       </form-beans>
     
       <global-forwards>
       <forward name="vueProduits" path="/vues/Produits.jsp"></forward>
       <forward name="vueCercles" path="/vues/Cercles.jsp"></forward>
       </global-forwards>
     
       <action-mappings>
     
       <action 
       path="/catal"
       name="pf"
       type="Web.ProduitAction"
       scope="session"
       />
     
     
        <action 
       path="/combo"
       name="f"
       type="Web.CercleAction"
       scope="session"
       />
     
     
     
     
       </action-mappings>
     
      <message-resources parameter="ApplicationResources"/>
    </struts-config>

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Cannot find bean busliste in any scope
    Par zaineb.z dans le forum Struts 1
    Réponses: 2
    Dernier message: 20/07/2007, 18h39
  2. Réponses: 2
    Dernier message: 30/05/2007, 20h25
  3. erreur cannot find bean..(débutant)
    Par mackab dans le forum Struts 1
    Réponses: 16
    Dernier message: 11/05/2007, 17h29
  4. erreur cannot find bean under name liste
    Par spidereck dans le forum Struts 1
    Réponses: 3
    Dernier message: 20/04/2007, 10h05
  5. logic:Iterate - cannot find bean
    Par nathalie2266 dans le forum Struts 1
    Réponses: 3
    Dernier message: 06/01/2007, 19h52

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo