我正在做一个Java(JSP + Servlet)Web应用程序(我知道这个问题与技术无关).我希望使用最新的Goolge reCAPTCHA服务.
我正在玩这里找到的Goolge reCAPTCHA示例:
https://developers.google.com/recaptcha/docs/display#config
<html>
<head>
<title>reCAPTCHA demo: Simple page</title>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</head>
<body>
<form action="?" method="POST">
<div class="g-recaptcha" data-sitekey="my_site_key"></div>
<br/>
<input type="submit" value="Submit">
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我能够看到显示的recaptcha图像如下:

当我检查"我不是机器人"时,我得到以下信息:

如您所见,有一个验证按钮,根据我的测试,用户响应会发送给Google进行验证.
如何获取用户响应,以便我可以在自己的后端代码中验证用户响应(如Google建议的https://developers.google.com/recaptcha/docs/verify).
g-recaptcha-response POST parameter when the user submits the form on your site
Run Code Online (Sandbox Code Playgroud)
在服务器端,我可以通过点击"提交"按钮,仅在首先使用Google成功验证用户时才从参数"g-recaptcha-response"获取用户输入.否则,"g-recaptcha-response"在服务器端是空白的.这意味着只有在客户端验证成功后才能进行服务器端验证.如果是这样,那么在服务器端进行另一次验证有什么意义,这是Google reCAPTHA提供的选项?
我错过了什么吗?