Do you want to do the validation on the front-end? or back-end?
To raise an alert from the back end just simply do your comparison with the params and if there is an issue, add this :
flash.message = "What ever your error is"
flash.alertType = "danger"
and then in the GSP
<g:if test="${flash.message}">
<div class="alert<g:if test="${flash.alertType}"> alert-${flash.alertType}</g:if> fade in">
<button class="close" data-dismiss="alert">×</button>
${flash.message}
</div>