Bonjour,

je souhaite remplir une liste deroulante a partir de ma jsp en faisant un select dans un fichier. J'ai des erreurs dans mon code que voici:

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
<tr>
<td>Profil:</td>
<td>
<select name="profil" id="profil"> 
<% Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/gestion_parc", "root", "");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT libelle, id FROM profils;");
rs.last();
int nb=rs.getRow();
rs.beforeFirst();
int i = 1;
while(rs.next()){
rs.absolute(i);
String code = rs.getString(2);
String lib = rs.getString(1);
%>
     <option value="<%=code%>"><%=lib%></option>
<%}%>
</select>
<p></td>
</tr>
l'erreur suivante est signalee sur les balises ci-dessus en rouge :

Syntax error on token(s), misplaced construct(s)