I have a Servlet and JavaBean working with my formPage.jsp where the jsp has input values and they are validated using JavaBean and Servlet. It works where it also gives a message of how many validations are needed and gives field validation message next to each field that has a validation issue.
Now I want to make it more efficient because I seem to be double coding where I am doing validation in both my Servlet and Bean. For example this condition is repeated in both Bean and Servlet:
Here is my Bean condense to show just one out of my 10 fields:
Servlet Controller condense to show 1 out of the 10 fields: