j'ai suivie ce tuto afin de pouvoir integrer une vérification captcha sur mon site, voilà mon formulaire

index.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
 
<%@ page import="net.tanesha.recaptcha.ReCaptcha" %>
<%@ page import="net.tanesha.recaptcha.ReCaptchaFactory" %>
....
<form action="captchaVerif" method="post" class="register modalReg" role="form">
                                <!-- CAPTCHA -->
                                <%
                                    ReCaptcha c = ReCaptchaFactory.newReCaptcha("6LfqPx8TAAAAAFzuETMyu_P7c97E7zBjK2aYhSWj", "6LfqPx8TAAAAAHGYhRS4W6PVFyCV3fJwo74NqNxl", false);
                                    out.print(c.createRecaptchaHtml(null, null));
                                %>
                                <!-- CAPTCHA -->
                                <br>
                                <button value="reg" type="submit" class="btn btn-primary btn-lg btn-block">S'inscrire</button>
                            </form>
j'ai créé un servlet "captchaVerif.java" comme ceci
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
 
import net.tanesha.recaptcha.ReCaptchaImpl;
import net.tanesha.recaptcha.ReCaptchaResponse;
...
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            /* TODO output your page here. You may use following sample code. */
            out.println("<!DOCTYPE html>");
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet captchaVerif</title>");            
            out.println("</head>");
            out.println("<body>");
            out.println("<h1>Votre Captcha est invalide " + request.getContextPath() + "</h1>");
            out.println("<h1>Veuillez <a href='index.jsp'>réessayer</a></h1>");
            out.println("</body>");
            out.println("</html>");
        } finally {
            out.close();
        }
    }
....
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
 
        String remoteAddr = request.getRemoteAddr();
        ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
        reCaptcha.setPrivateKey("6LfqPx8TAAAAAHGYhRS4W6PVFyCV3fJwo74NqNxl");
 
 
        String challenge = request.getParameter("recaptcha_challenge_field");
        String uresponse = request.getParameter("recaptcha_response_field");
        ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remoteAddr, challenge, uresponse);
 
 
        if (reCaptchaResponse.isValid()) {
          out.print("Answer was entered correctly!");
          RequestDispatcher disp = request.getRequestDispatcher("inscription.jsp");
                    disp.forward(request, response);
        } else {
          processRequest(request, response);
        }
    }
mais que ce soit mon captcha est vrai ou faux je reçois toujours le message d'erreur, le passage à inscription.jsp ne se passe jamais, pourquoi ???

voici le captcha que j'ai eu en affichage
Nom : 2016-05-06_15-50-02.jpg
Affichages : 335
Taille : 25,8 Ko