score:6

Accepted answer

I think you're on the right track. There's no direct way I know of to get all the object error messages and field error messages in one aggregated list, however you can do this:

#springBind("bindName")
#if($status.errors.hasErrors())
    ## Global error messages
    #foreach($e in $status.errorMessages)
        <p>${e}</p>
    #end
    ## Field error messages
    #foreach($f in $status.errors.fieldErrors)
        #springBind("bindName.${f.field}")
        #foreach($e in $status.errorMessages)
            <p>${e}</p>
        #end
    #end
#end

Not so clean, but it works.


Related Query

More Query from same tag