0

In Grails Spring Security UI Register Flash Messages a question is answered on how to display error messages coming from the Spring Security UI plugin. The discussion shows, that errors can be displayed like this:

<g:hasErrors>
    <g:eachError>
        <li><g:message error="${it}"/></li>
    </g:eachError>
</g:hasErrors>

My Problem is as follows: I dont simply want to display a list of errors, but to display the error with the input field, to which it belongs to.

Example: I dont put at least 6 characters into the input field password. So on the right of the input the error message "Please choose at least 6 characters" would be rendered.

How can I achieve this?

Greetings

Community
  • 1
  • 1
dildik
  • 405
  • 6
  • 16
  • 1
    Take a look at answer: http://stackoverflow.com/questions/10943684/in-grails-how-do-i-display-validation-error-messages-next-to-the-fields – user553180 Nov 01 '12 at 17:12
  • Thanks, but this doesnt work for me. When I write in the register view, i dont get the errors for the email field. Maybe the bean is wrong, I dont know. Do you know, how to write this correctly? – dildik Nov 01 '12 at 18:48
  • I also tried different variations of bean, like : . I used registerCommand to overwrite the flash messages, but this doesnt work to show errors on the page. What is my mistake? – dildik Nov 01 '12 at 18:59

0 Answers0