Image is not displaying for simple-captcha in Grails

时间:2016-04-15 14:54:24

标签: grails grails-plugin

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>

1 个答案:

答案 0 :(得分:3)

您使用的是错误的网址。变化

<img src="${createLink(controller: 'user', action: 'register')}"/>

<img src="${createLink(controller: 'simpleCaptcha', action: 'captcha')}"/>

现在,您的图像将会显示,您可以输入验证码并提交表格。在register控制器的user操作中,您现在会看到params.captcha