The image is not displaying for Grails simple-captcha
plugin.
While printing params.captcha in controller null value is printed.
What might be the solution? I would be thankful if anyone mention steps to integrate simple-captcha
plugin in Grails 2.3.3. My GSP page code is:
<g:form controller="user" action="register">
<g:textField name="email" placeholder="email"/><br>
<g:passwordField name="password" placeholder="password"/><br>
<img src="${createLink(controller: 'user', action: 'register')}"/>
<label for="captcha">Type the letters above in the box below:</label>
<g:textField name="captcha"/>
<g:actionSubmit value="register" action="register" /><br>
</g:form>
答案 0 :(得分:3)
您使用的是错误的网址。变化
<img src="${createLink(controller: 'user', action: 'register')}"/>
到
<img src="${createLink(controller: 'simpleCaptcha', action: 'captcha')}"/>
现在,您的图像将会显示,您可以输入验证码并提交表格。在register
控制器的user
操作中,您现在会看到params.captcha
。