I looked at various frameworks for validating input, including the Hibernate Validator impl for the JSR 303 bean validation, as well as the ESAPI authentication interface and DefaultValidator .
ESAPI input validation revolves around matching a regular expression pattern through the ESAPI.properties file.
ESAPI Route :
ESAPI.properties:
Validator.SafeString=[A-Za-z0-9]{0,1024}$
Java class:
ESAPI.validator().isValidInput("Name","darthvader", "SafeString", 255, false)
Hibernate Validator / Spring MVC Route
Hibernate includes annotation of your bean with various constraint annotations (@NotNull, @Size, @Min, @Pattern, @Valid, etc.). And Spring MVC integration for validation rules.
@RequestMapping(value = "/appointments", method = RequestMethod.POST) public String add(@Valid User user, BindingResult result) { .... }
It seems that using Hibernate Validator / Spring MVC provides similar functionality using regex, etc. Are there any advantages to using the ESAPI library over the Hibernate validator api? Maybe for SQL injection / XSS or something like that? XSS / SQL implementation protection provided out of the box to validate ESAPI input? Any real advantages over using one or the other. Thanks in advance.
Answer my own question: I think I have come to my decision on this post. Using Hibernate / Spring MVC allows for quite robust w810 validation functionality. And Hibernate provides secure annotations like @SafeHtml, @Pattern, etc. Basically, we can set up a composite set of annotations that provide bean validation. http://docs.jboss.org/hibernate/validator/5.0/reference/en-US/html_single/