Bonjour,

Pour un projet de cour j'ai une petite appli a faire en jsp.

J'ai un soucis pour recuperer le nombre de tour mis dans la session et je ne comprend pas pourquoi....

Code :
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
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    <% int nbtours=Integer.parseInt(session.getAttribute("nbTours"));
      if(nbtours == 10 )
      {%>
      <jsp:forward page="fin.php"></jsp:forward>
      <%}else
        {
        nbtours++;
        session.setAttribute("nbTours",nbtours);
        }%>
    </head>
    <body>
    <% if(Integer.parseInt(request.getParameter("nb1"))+Integer.parseInt(request.getParameter("nb2")) == Integer.parseInt(request.getParameter("answer")))
            {%>
            <h1>Bravo</h1>
            <%}else{%> 
            <h1>Raté, la bonne réponse était : <%=Integer.parseInt(request.getParameter("nb1"))+Integer.parseInt(request.getParameter("nb2"))%></h1>
            <%}%>
     <a href="serie1.jsp">suite de la série </a>
 
 
    </body>
</html>
message d'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
/usr/local/apache-tomcat-4.1.34-LE-jdk14/work/Standalone/localhost/education/traitement_jsp.java:44: cannot find symbol
symbol  : method parseInt(java.lang.Object)
location: class java.lang.Integer
                                                       int nbtours=Integer.parseInt(session.getAttribute("nbTours"));