Solution :
Please find the solution for your error as follows:
if (ValidateUtil.isNullOrEmpty(lastName)) {
registrationErrors.add(ValidateErrors.LAST_NAME);
}
if (!ValidateUtil.isEmailValid(email)) {
registrationErrors.add(ValidateErrors.EMAIL);
}
I have gone through your problem in above code snippet you are checking for null or empty value on only lastname, but not on isEmailValid for empty value. So you will need something like below code change that will help you.
if (ValidateUtil.isNullOrEmpty(email) || ! ValidateUtil.isEmailValid(email)) {
registrationErrors.add(ValidateErrors.EMAIL);
}
OR
you can fix your ValidateUtil.isEmailValid() to just cope up with the null email values. It will not crash but it will only return false.
OR
There is one more way to fix your issue.
It will work when you will throw away next line from your form:
enctype="multipart/form-data"
And you will pass all parameters at the request ok:
<form action="/registrationform" method="post">
<%-- error messages --%>
<div class="form-group">
<c:forEach items="${registrationError}" var="error">
<p class="error">${error}</p>
</c:forEach>
</div>