The Spring Security project provides support for protecting web applications from malicious exploits. See the Spring Security reference documentation, including:

HDIV is another web security framework that interacts with Spring MVC.