Bonjour tout le monde, j'ai une exception lorsque je veux charger ma liste du genre :je c'est que c'est parce que il ne trouve pas ma liste mais je ne c'est pas du tout où?
Code : Sélectionner tout - Visualiser dans une fenêtre à part ServletException in:/jsp/prive/contact/formulaire.jsp] Failed to obtain specified collection'
ActrionFormMon sqlProvider
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 public class FormulaireAction extends JdcBaseAction { public ActionForward executeLogic(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) throws Exception { logger.info("entre Dans l'action FormulaireAction"); FormulaireActionForm actionForm = (FormulaireActionForm) form; HttpSession session = request.getSession(true); //test session if ( (actionForm == null) || session.isNew()) { actionForm = new FormulaireActionForm(); actionForm.reset(mapping, request); session.setAttribute("formulaireActionForm", actionForm); } //recupération de la session SessionJDC sJDC = new SessionJDC(session); //test formulaire public ou non public String publi=request.getParameter("public"); if (publi!=null){ if (publi.equals("true")){ actionForm.setPartiePublique(true); } session.setAttribute("formulaireActionForm", actionForm); } //recupération du compte UtilCompteOBJ compte = sJDC.getCompte(); //test si le compte est null if ( compte!= null){ UtilPersonneOBJ titulaire = compte.getLnkUtilPersonne(); //on rempli les champs actionForm.setNom(titulaire.getNom()); actionForm.setPrenom(titulaire.getPrenom()); actionForm.setRaisonSociale(compte.getRaisonSocialeClient()); actionForm.setMail(titulaire.getMail()); actionForm.setTelephone(titulaire.getNumeroTelephone()); actionForm.setCivilite(titulaire.getCivilite()); actionForm.setTelephone(titulaire.getNumeroTelephone()); } //EJB ContactEJB ejb; Localiseur localiseur = new Localiseur(); ContactEJBHome home = (ContactEJBHome) localiseur.getHomeObject(ContactEJBHome.JNDI_NAME); ejb = home.create(); logger.info("test categorie"); //test pour le remplissage de la categorie if (actionForm.getListeCategorie() == null) { logger.info("dans le if test categorie"); ArrayList listeCategorie = ejb.getListeCategorie(actionForm.isPartiePublique()); actionForm.setListeCategorie(listeCategorie); } logger.info("sort du if test categorie"); String forward="FORMULAIRE"; //-------------------------- // GESTION BOUTON ENNVOYER //-------------------------- if (actionForm.getEnvoyer().isSelected()) { logger.info("clic sur le bouton envoyer"); //ejb.getSoumettre(); forward = "VISUALISER"; } logger.info("sort de l'action formulaireAction"); return mapping.findForward(forward); } }
Est que quelqu'un à une idée??? svp
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 public class CategorieSQLProvider extends AbstractSQLProvider { private static final String REQUETE = " select cca_id, cca_libelleCategorie " + " from e_com_categorie " + " where cca_typeCategorie in (?,?) " ; /** * Crée un objet <code>CategorieSQLProvider</code> */ public CategorieSQLProvider() { } public ArrayList getListeCategorie(Connection con , boolean isPartiePublique)throws SQLException { ResultSet rs = null; ArrayList retour =null; retour= new ArrayList(); PreparedStatement ps = null; logger.logInfo("dans la methode execute avant le preparestatement"); String header = ("CategorieSQLProvider.getListeCategorie"); try { logger.logInfo("entre dans "+header); logger.logInfo("requete :"+REQUETE+"param:"+CategorieOBJ.PUBLIC_ONLY+ CategorieOBJ.PUBLIC_AND_PRIVE+ CategorieOBJ.PRIVE_ONLY); ps = con.prepareStatement(REQUETE); if (isPartiePublique == true){ ps.setInt(1, CategorieOBJ.PUBLIC_ONLY); ps.setInt(2, CategorieOBJ.PUBLIC_AND_PRIVE); } else { ps.setInt(1,CategorieOBJ.PRIVE_ONLY); ps.setInt(2,CategorieOBJ.PUBLIC_AND_PRIVE); } rs = ps.executeQuery(); CategorieOBJ cat=null; while (rs.next()) { cat = new CategorieOBJ(); logger.logInfo("param"+rs.getString(1)+rs.getString(2)); cat.setLibelle(rs.getString(2)); cat.setId(rs.getInt(1)); retour.add(cat); } } catch (SQLException ex) { throw ex; } finally { close(rs); close(ps); } logger.logInfo("sors de "+header); return retour; } }
Partager