title: captcha validating in sign in page using Java code
body: <p>I have trying to login in the page with captcha in JSP and Servlet code using the google recaptcha code. I am getting the error as "Recaptcha V1 is shutdown" as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/oK9EF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oK9EF.jpg" alt="enter image description here"></a></p>
  
  <p>Code used for captcha:</p>
  
  <p><strong>JSP page</strong></p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  
  &lt;%@ page import="net.tanesha.recaptcha.ReCaptcha" %&gt;
  &lt;%@ page import="net.tanesha.recaptcha.ReCaptchaFactory" %&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;CAPTCHA in Java using reCAPTCHA&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h2&gt;CAPTCHA in Java Application using reCAPTCHA&lt;/h2&gt;
  &lt;form action="validate.jsp" method="post"&gt;
  &lt;p&gt;Username: &lt;input type="text" name="user"&gt;&lt;/p&gt;
  &lt;p&gt;Password: &lt;input type="password" name="password"&gt;&lt;/p&gt;
  &lt;p&gt;
  &lt;%
      ReCaptcha c = ReCaptchaFactory.newReCaptcha(
                  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 
                  "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy", false);
      out.print(c.createRecaptchaHtml(null, null));
  %&gt;
     &lt;input type="submit" value="submit" /&gt;
  &lt;/p&gt;        
          &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Validate.Jsp</strong></p>
  
  <pre><code>  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
          pageEncoding="ISO-8859-1"%&gt;
      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
      &lt;%@ page import="net.tanesha.recaptcha.ReCaptchaImpl"%&gt;
      &lt;%@ page import="net.tanesha.recaptcha.ReCaptchaResponse"%&gt;
  
      &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;CAPTCHA in Java using reCAPTCHA&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h2&gt;CAPTCHA in Java Application using reCAPTCHA&lt;/h2&gt;
  &lt;p&gt;
      &lt;%
          String remoteAddr = request.getRemoteAddr();
          ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
          reCaptcha.setPrivateKey("xxxxxxxxxxxxxxxxxxxx");
  
          String challenge = request
                  .getParameter("recaptcha_challenge_field");
          String uresponse = request.getParameter("recaptcha_response_field");
          ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(
                  remoteAddr, challenge, uresponse);
  
          if (reCaptchaResponse.isValid()) {
              String user = request
                      .getParameter("user");
              out.print("CAPTCHA Validation Success! User "+user+" registered.");
      } else {
              out.print("CAPTCHA Validation Failed! Try Again.");
          }
      %&gt;
  &lt;/p&gt;
  &lt;a href="."&gt;Home&lt;/a&gt;    
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help me to resolve the issue.</p>