servlets - captcha error on jsp -


i have captcha on jsp form , response enter in wrong condition never enter in wright 1

here jsp code:

<%@ page import="net.tanesha.recaptcha.recaptcha" %> <%@ page import="net.tanesha.recaptcha.recaptchafactory" %> <form action="captchaverif" method="post" class="register modalreg" role="form">           <!-- captcha -->          <div class="g-recaptcha" data- sitekey="6lcxqb8taaaaann08bywsrspvqjh_5feqpnxshin"></div>          <!-- captcha -->          <button value="reg" type="submit" class="btn btn-primary btn-lg-btn-block">s'inscrire</button>       </form> 

and here servlet :

string remoteaddr = request.getremoteaddr();     recaptchaimpl recaptcha = new recaptchaimpl();     recaptcha.setprivatekey("6lcxqb8taaaaakkxkr4uwte--l1vwgmqkwgf6mga");      string challenge = request.getparameter("recaptcha_challenge_field");     string uresponse = request.getparameter("recaptcha_response_field");     recaptcharesponse recaptcharesponse = recaptcha.checkanswer(remoteaddr, challenge, uresponse);      if (recaptcharesponse.isvalid()) {         response.sendredirect("inscription.jsp"); //doesn't enter here     }      if (!recaptcharesponse.isvalid()){       processrequest(request, response); //always enter here      } 

i can't find error ?


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -