[ https://issues.apache.org/jira/browse/SLING-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13619952#comment-13619952 ]
Alexander Klimetschek commented on SLING-2803: ---------------------------------------------- I see three parts: a) the validation system that can validate a given resource (tree) (using sling resource API) b) post processor et al. that can be easily triggered to run validation based on a given resource type, some flags etc. c) application code that will make sure those triggers are set For a) the general design can learn from what's already in the world. I guess we have things like reusable constraints (like "email") that can be attached to multiple properties, property level constraints as well as global constraints that check validity between multiple properties or even resources, multiple constraints per property etc. For b) we might want to trigger a certain validation "type" by passing a request attribute (e.g. force.validation.type=my/resource/type), but we might also want to automatically run validation for plain sling post servlet requests, in which case there needs to be a configuration what validators for which resource types should run automatically (the post processor would look up the rt of the changed items) - although we need to be careful not to slow down things here. c) would be handled by the request attribute (for the post servlet forward case) and a simple service API to run validators easily. > Create a Validation module capable of validating POST requests or Resources > --------------------------------------------------------------------------- > > Key: SLING-2803 > URL: https://issues.apache.org/jira/browse/SLING-2803 > Project: Sling > Issue Type: New Feature > Reporter: Radu Cotescu > > Several Sling users have asked in the past [1] about a Validation mechanism > in Sling that's able to validate data coming from the user. However, such a > module is still missing. > This issue is meant to track the work progress on such a module. > Ideally the module should be able to validate both request parameters and > Resources, by obtaining their properties via a ValueMap and provide feedback > in case of a validation error. > [1] - http://sling.markmail.org/search/?q=validation -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira