Voici mon probleme qui est assez urgent Merci a vous:
Voici le contenu des 2 fichiers en Questionsdescription Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la requête.
cause mère
org.apache.jasper.JasperException: Impossible de compiler la classe pour la JSP
Une erreur s'est produite à la ligne: 7 dans le fichier jsp: /jenipy/admin/index.jsp
Erreur de servlet générée:
GestionDB cannot be resolved to a type
Une erreur s'est produite à la ligne: 7 dans le fichier jsp: /jenipy/admin/index.jsp
Erreur de servlet générée:
GestionDB cannot be resolved to a type
Une erreur s'est produite à la ligne: 33 dans le fichier jsp: /jenipy/admin/index.jsp
Erreur de servlet générée:
dateStandard cannot be resolved
Une erreur s'est produite à la ligne: 33 dans le fichier jsp: /jenipy/admin/index.jsp
Erreur de servlet générée:
dateStandard cannot be resolved
Une erreur s'est produite à la ligne: 86 dans le fichier jsp: /jenipy/admin/index.jsp
Erreur de servlet générée:
dateStandard cannot be resolved
Une erreur s'est produite à la ligne: 86 dans le fichier jsp: /jenipy/admin/index.jsp
Erreur de servlet générée:
dateStandard cannot be resolved
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
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 <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page import="java.sql.*" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ include file="../scripts/fonctions.jsp" %> <% GestionDB db = new GestionDB(); db.connect(); %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="style.css" type="text/css" /> <script type="text/javascript" language="JavaScript" src="admin.js" /> <title>Administration de ESI'Book</title> </head> <body> <div id="global"> <div id="raff"><center><input type="button" value="Raffraichir la liste des utilisateurs" onclick="raffraichirListes();" /></center></div> <h2>Utilisateurs bloqués</h2> <div id="listeBloques" style=""> <table> <tr> <th>Pseudo</th> <th>Sexe</th> <th>Adresse Mail</th> <th>Date de naissance</th> <th>Date de création</th> <th>Actions</th> </tr> <% ResultSet res1 = db.getLesUtilisateursBloques(); while (res1.next()) { String pseudo = res1.getString("pseudo"); String adresseMail = res1.getString("adressemail"); Date dateDeNaissance = res1.getDate("datenaissance"); Date dateDeCreation = res1.getDate("datedecreation"); Boolean sexe = res1.getBoolean("sexe"); Boolean bloque = res1.getBoolean("comptebloque"); out.print("<tr>"); out.print("<td>" + pseudo + "</td>"); if (sexe == Boolean.TRUE) { out.print("<td>Homme</td>"); } else { out.print("<td>Femme</td>"); } out.print("<td>" + adresseMail + "</td>"); out.print("<td>" + dateStandard.format(dateDeNaissance) + "</td>"); out.print("<td>" + dateStandard.format(dateDeCreation) + "</td>"); if (bloque == Boolean.TRUE) { out.print("<td><span class=\"action\" onclick=\"debloquer('" + adresseMail + "')\">Débloquer</span> | "); } else { out.print("<td><span class=\"action\" onclick=\"bloquer('" + adresseMail + "')\">Bloquer</span> | "); } out.print("<span class=\"action\" onclick=\"supprimer('" + adresseMail + "')\">Supprimer</span> </td>"); out.print("</tr>"); } %> </table> </div> <br /> <h2>Gestion des comptes</h2> <div id="listeComptes" style=""> <table> <tr> <th>Pseudo</th> <th>Sexe</th> <th>Adresse Mail</th> <th>Date de naissance</th> <th>Date de création</th> <th>Actions</th> </tr> <% ResultSet res2 = db.getToutLesUtilisateurs(); while (res2.next()) { String pseudo = res2.getString("pseudo"); String adresseMail = res2.getString("adressemail"); Date dateDeNaissance = res2.getDate("datenaissance"); Date dateDeCreation = res2.getDate("datedecreation"); Boolean sexe = res2.getBoolean("sexe"); Boolean bloque = res2.getBoolean("comptebloque"); String DDN = ""; String DDC = ""; if(dateDeNaissance != null) DDN = dateStandard.format(dateDeNaissance); else DDN = "N/A"; if( dateDeCreation != null) DDC = dateStandard.format(dateDeCreation); else DDC = "N/A"; out.print("<tr>"); out.print("<td>" + pseudo + "</td>"); if (sexe == Boolean.TRUE) { out.print("<td>Homme</td>"); } else { out.print("<td>Femme</td>"); } out.print("<td>" + adresseMail + "</td>"); out.print("<td>" + DDN + "</td>"); out.print("<td>" + DDC + "</td>"); if (bloque == Boolean.TRUE) { out.print("<td><span class=\"action\" onclick=\"debloquer('" + adresseMail + "')\">Débloquer</span> | "); } else { out.print("<td><span class=\"action\" onclick=\"bloquer('" + adresseMail + "')\">Bloquer</span> | "); } out.print("<span class=\"action\" onclick=\"supprimer('" + adresseMail + "')\">Supprimer</span> | "); out.print("<span class=\"action\" onclick=\"this.parentNode.parentNode.nextSibling.style.display = (this.parentNode.parentNode.nextSibling.style.display == 'none')?'table-row':'none'\">Changer mot de passe</span> | "); out.print("<span class=\"action\" onclick=\"this.parentNode.parentNode.nextSibling.nextSibling.style.display = (this.parentNode.parentNode.nextSibling.nextSibling.style.display == 'none')?'table-row':'none'\">Changer adresse mail</span> </td>"); out.print("</tr>"); out.print("<tr style=\"display:none\" >"); out.print("<td colspan=\"6\">"); out.print("<span style=\"margin-right:1em;font-size:small;color:#58F;font-weight:bold;\">Changer le mot de passe de " + pseudo + "</span>"); out.print("<input stype=\"text\" size=\"20\" maxlength=\"16\" id=\"pass_" + adresseMail + "\" />"); out.print("<input type=\"button\" value=\"Valider\" onclick=\"changerPasse('" + adresseMail + "')\" />"); out.print("<div id=\"ajax_mdp_" + adresseMail + "\"></div>"); out.print("</td></tr>"); out.print("<tr style=\"display:none\" >"); out.print("<td colspan=\"6\">"); out.print("<span style=\"margin-right:1em;font-size:small;color:#58F;font-weight:bold;\">Changer l'adresse mail de " + pseudo + "</span>"); out.print("<input stype=\"text\" size=\"20\" maxlength=\"16\" id=\"nemail_" + adresseMail + "\" />"); out.print("<input type=\"button\" value=\"Valider\" onclick=\"changerMail('" + adresseMail + "')\" />"); out.print("<div id=\"ajax_mail_" + adresseMail + "\"></div>"); out.print("</td></tr>"); } %> </table> </div> </div> </body> </html> <% db.close();%>
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
212
213
214
215
216
217
218
219
220
221 <%@ page language="java" import="java.sql.*" %> <%@ page language="java" import="java.io.*" %> <%@ page language="java" import="java.text.SimpleDateFormat" %> <%@ page language="java" import="java.util.Date" %> <%@page contentType="text/html" pageEncoding="ISO-8859-1" language="java" import="java.security.*"%> SimpleDateFormat dateStandard = new SimpleDateFormat("dd/MM/yyyy"); public class SQL { String dbURL; String user; String pass; String dbDriver = "org.postgresql.Driver"; private Connection dbCon; public SQL(String url, String user, String pass) { super(); dbURL = url; this.user = user; this.pass = pass; } public SQL(String user, String pass) { super(); dbURL = "jdbc:postgresql://localhost"; this.user = user; this.pass = pass; } public SQL() { super(); dbURL = "jdbc:postgresql://localhost:5432"; this.user = "itc72"; this.pass = "to21to"; } public boolean connect() throws ClassNotFoundException, SQLException { Class.forName(dbDriver); dbCon = DriverManager.getConnection(dbURL, user, pass); return true; } public ResultSet execSQL(String sql) throws SQLException { Statement s = dbCon.createStatement(); ResultSet r = s.executeQuery(sql); return (r == null) ? null : r; } public int updateSQL(String sql) throws SQLException { Statement s = dbCon.createStatement(); int r = s.executeUpdate(sql); return (r == 0) ? 0 : r; } public void close() throws SQLException { dbCon.close(); } } public class GestionDB { public SQL Database; GestionDB() { this.Database = new SQL(); } public boolean connect() { try { return Database.connect(); } catch (Exception e) { return false; } } public ResultSet getLesUtilisateursBloques() { try { String req = " SELECT * FROM \"lesutilisateurs\" WHERE \"comptebloque\" = true ORDER BY \"pseudo\" ASC"; return Database.execSQL(req); } catch (Exception e) { return null; } } public ResultSet getToutLesUtilisateurs() { try { String req = "SELECT * FROM \"lesutilisateurs\" ORDER BY \"pseudo\" ASC";"; return Database.execSQL(req); } catch (Exception e) { return null; } } public ResultSet getLesMessages (String adressemail) { try { String req = "SELECT * FROM \"lesmessages\" WHERE \"destinataire\" = '" + adressemail + "' ORDER BY \"id\" ASC";"; return Database.execSQL(req); } catch (Exception e) { return null; } } public ResultSet getCoordonnees (String adressemail) { try { String req = "SELECT * FROM \"lesutilisateurs\" WHERE \"emetteur\" = '" + adressemail + "';"; return Database.execSQL(req); } catch (Exception e) { return null; } } public int debloquerUtilisateur(String adressemail) { try { String req = "UPDATE \"lesutilisateurs\" SET \"comptebloque\"=false WHERE \"adressemail\" = '" + adressemail + "';"; return Database.updateSQL(req); } catch (Exception e) { return -1; } } public int bloquerUtilisateur(String adressemail) { try { String req = "UPDATE \"lesutilisateurs\" SET \"comptebloque\"=false WHERE \"adressemail\" = '" + adressemail + "';"; return Database.updateSQL(req); } catch (Exception e) { return -1; } } public int supprimerUtilisateur(String adressemail) { try { String req = "DELETE FROM \"lesutilisateurs\" WHERE \"adressemail\" = '" + adressemail + "';"; return Database.updateSQL(req); } catch (Exception e) { return -1; } } public boolean changerMotDePasse(String mail, String mdp) { boolean resu = false; try { String req = "UPDATE \"lesutilisateurs\" SET \"motdepasse\"='" + mdp + "' WHERE \"adressemail\" = '" + mail + "';"; int res = Database.updateSQL(req); if(res == 1) { resu = true; } } catch (Exception e) { ; } return resu; } public boolean changerMail(String mail, String nemail) { boolean resu = false; try { String req = "UPDATE \"lesutilisateurs\" SET \"adressemail\"='" + nemail + "' WHERE \"adressemail\" = '" + mail + "';"; int res = Database.updateSQL(req); if(res == 1) resu = true; } catch (Exception e) { ; } return resu; } }
Partager