chkal/pf-issue-test — Issue #70: Provide extension point for custom validation of path and query parameters
Author: chkal
Created: 2012-03-06 07:28:19+00:00
State: open

Originally filed by **chkalt** on 2010-10-18T15:18:14

Google Code issue: http://code.google.com/p/prettyfaces/issues/detail?id=70

We should offer an extension point for custom validation of query and path parameters. The attached patch adds an SPI called ValidationExtension to PrettyFaces:

public interface ValidationExtension
{
public void validate(FacesContext facesContext, UrlMapping mapping,
RequestParameter requestParameter, Object value) throws ValidatorException;
}

I've created a proof-of-concept extension to integrate JSF303 "Bean Validation" into PrettyFaces:

http://github.com/chkal/prettyfaces-validation

As the extension point is a long-living part of PrettyFaces, which we cannot easily change without breaking existing extensions, I'm uploading the patch here for a public review. :-)