2. MyFaces Extensions-Validator
What’s new in version 1.x.2
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 2
3. Agenda
• Improved Trinidad Support
• Cross-validation vs.
Model-Aware Cross-validation
• Reverse Violation Messages
• MetaDataExtractionInterceptors
• Optional Custom Skip-Validation Markers
• Pluggable Name-Mappers
• Improved EL-Map-Syntax Support
• New Add-ons
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 3
4. Improved Trinidad Support
• Improved client-side validation
• Support for
• CoreOutputLabel
• LabeledFacesMessage
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 4
5. Cross-validation vs. Model-
Aware Cross-validation
• Cross-validation now detects the target
automatically
• That means:
If the validation target isn’t available in the
current request, validation is performed
with the model value
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 5
6. Reverse Violation Messages
• Model aware cross-validation might lead to
• Inconsistent validation messages
• Missing target to display validation error msg
• Solution: reverse validation message
• Optional possibility to provide a meaningful
validation error message
• Displayed at the source component
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 6
7. MetaDataExtractionInterceptors
• Interceptor which is called after the
metadata extraction and before the
validation process
• Possibility to add/change/remove
constraints of the target property
• Global mechanism
• ExtValContext.getContext()
.addMetaDataExtractionInterceptor(...)
• @MetaDataExtractionInterceptor
(available at the os890 ExtVal-Add-ons)
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 7
8. Optional Custom Skip-Validation
Markers
• Default marker for skipable validation
strategies is: @SkipValidationSupport
• Now it’s possible to provide
• Custom marker annotation(s)
• Directly the validation strategy which is skipable
e.g. via:
//optional: direct usage of validation strategies
StaticInMemoryConfiguration config =
new StaticInMemoryConfiguration();
config.addMapping(CommonMetaDataKeys.SKIP_VALIDATION,
RequiredStrategy.class.getName());
ExtValContext.getContext()
.addStaticConfiguration(StaticConfigurationNames
.SKIP_VALIDATION_SUPPORT_CONFIG, config);
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 8
9. Pluggable Name-Mappers
• Name-Mappers were located within
factories
• Now it’s possible to register
name-mappers via ExtVal-Java-API – e.g.:
ExtValContext.getContext().getFactoryFinder()
.getFactory(FactoryNames.VALIDATION_STRATEGY_FACTORY,
NameMapperAwareFactory.class))
.register(metaDataToValidationStrategyNameMapper)
• Convenience methods are available at:
ExtValUtils
• @NameMapper
(available at the os890 ExtVal-Add-ons)
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 9
10. Improved EL-Map-Syntax
Support
• Improved support for nested map el-
syntax in view of cross-validation
• Bugfixes for ExtVal 1.1.1
(improved support of custom facelets
components)
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 10
11. New Add-ons
• Bypass validation
• Bypass validation for action methods
• Bypass validation via Validation-Controller
• Secure action methods
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 11
12. Bypass Validation - Details
• Bypass validation for action methods
3 example
usages:
• Bypass validation via Validation-Controller
2 example
usages:
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 12
13. Secure action methods - Details
• Available attributes
• viewIds
• permittedIf
• secureAction
• secureOutcome
• securityErrorMsgKey
• regularLifecycleExecution
• Further details at:
http://os890.blogspot.com/2009/04/myface
s-extval-add-on-securedaction.html
DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator
20.04.09 13