SlideShare a Scribd company logo
JSF in der Praxis
24.03.2010    DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   1
MyFaces Extensions-Validator
             What’s new in version 3




24.03.2010     DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   2
Agenda - 1
• Bean-Validation Integration Module
     (JSR 303 for JSF 1.x & 2.x + special Features)
• Improved Support for
  3rd Party Component Libraries
• Typesafe Constraint Parameters
• Constraint Severity
• Pluggable Storages
• Meta-Data Filters
• Validation Interception
24.03.2010       DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   3
Agenda - 2
• SkipValidationEvaluator
• Optional Invocation Order
• Integration of RAD-Add-on
• Additional Static Syntax for
  @JoinValidation
• Empty-/Null-Value Markers
• Other Improvements
• New Add-ons

24.03.2010   DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   4
Bean-Validation Integration
• JSR 303 for JSF 1.x and JSF 2.x
• Integration Module as alternative/addition
  to the Property-Validation Module
• Compatible with all BV conform
  implementations
• Module provides additional features
• Advantage: It’s the (new) standard
• Disadvantage: Not all features of ExtVal
  will be available (due to spec. restrictions)
24.03.2010    DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   5
ExtVal vs. JSF 2 BV-Integration
• With ExtVal
     • @NotNull validation enabled by default
       (deactivation via std. JSF config)
     • Typesafe group validation
             • No Validation Markup in the Page
             • The ExtValBeanValidationContext allows
               custom implementations e.g. tags, configs,…
     • Component initialization
       (e.g. @NotNull    client-side required)
     • Severity aware validation


24.03.2010             DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   6
ExtVal vs. JSF 2 BV-Integration
     • Model based validation
     • Sorted violation messages
     • Out-of-the-box dependency injection support
       for constraint-validators




24.03.2010       DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   7
ExtVal Annotations for BV
• @BeanValidation
  for Group-Validation
• @ModelValidation
  class level validation of an explicit or
  implicit target




24.03.2010     DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   8
@BeanValidation
• Normally used in Page-Beans
• Available attributes
     •       viewIds (default: * for all pages)
     •       useGroups (default: Default.class)
     •       restrictGroups (default: -)
     •       conditions (default: #{true})
     •       modelValidation (default: -)
     •       List
             (equivalent to multi-constraint syntax of JSR 303)


24.03.2010                DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   9
@BeanValidation - Examples
• Simple group validation
    @BeanValidation(useGroups=Admin.class)
• Group validation for a specific view
    @BeanValidation(viewIds="/login.xhtml",
      useGroups=Admin.class)
• If group validation is defined for the whole
  bean, it might be required to exclude
  groups for special properties and/or views
    @BeanValidation(restrictGroups=Admin.class)
• Conditional group validation
    @BeanValidation(useGroups = Admin.class,
      conditions="#{user.role.privileged}")
24.03.2010     DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   10
@ModelValidation
• To trigger bean-validation after
  „Update model values" phase
• Also uses information of @BeanValidation
• Difference:
  @ModelValidation isn‘t accumulated
• Available attributes
     •       isActive (default: false)
     •       displayInline (default: false)
     •       validationTargets (default: current base object)
     •       message (default: -)
24.03.2010              DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   11
3rd Party Component Libraries
• Improved support for
     • Trinidad
     • ICEfaces
     • RichFaces
• New sandbox project e.g. for external
  component support modules to improve
  compatibility with 3rd party component
  libraries
  (http://code.google.com/p/sandbox890)


24.03.2010         DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   12
Typesafe Constraint Parameters
• Similar to the payload-attribute of BV
  (Payload is the subset of Constraint
  Parameters of ExtVal)
• Allows typesafe and reusable parameters
• Simple example - alternative for:
    @MyConstraint(payload = "warn")
    With Bean-Validation:
    @MyConstraint(payload = Warn.class)
• Processed by Add-ons or Component
  Libraries
24.03.2010         DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   13
Constraint Severity
• Constraints with Severity Info and Warn
  don‘t "stop" the JSF-Lifecycle
• ExtVal 1.x.3 provides out-of-the-box
     •       ViolationSeverity.Info.class
     •       ViolationSeverity.Warn.class
     •       ViolationSeverity.Error.class (= default)
     •       ViolationSeverity.Fatal.class




24.03.2010              DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   14
Optional: Pluggable Parameters
• ExtVal allows to map custom classes to the
  default implementations (esp. to avoid
  dependencies of BV Constraints to ExtVal)
• Mapping via
     • Global-ExtVal-Parameter
     • Static config
• Examples are available in the ExtVal Wiki



24.03.2010      DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   15
Pluggable Storages
• Generic mechanism which provides scoped
  storages with custom APIs
• Allows to create multiple storages of the
  same type with different names
• Allows to create different storage types
• StorageManager (per storage type)
     • Responsible for scoping
     • Allows to create and reset (custom) storages
       via an API (independent of the storage type)
• Allows to provide custom (tweaked) storage
  implementations easily
24.03.2010       DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   16
Meta-Data Filters
• Filters meta-data before it gets added to the
  meta-data storage
• Only for static meta-data manipulation
• Meta-data extraction interceptors are only
  for dynamic meta-data manipulation




24.03.2010    DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   17
Validation Interception - 1
• Invocation:
     • Global interceptors:
       before and after the validation of a property
     • Local interceptors:
       before and after the validation of a constraint
• Allows to bypass validation of a
     • Property
     • Constraint



24.03.2010          DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   18
Validation Interception - Example
• Implementation
    public class CustomInterceptor
      implements PropertyValidationInterceptor {

             public boolean beforeValidation(
               FacesContext fC, UIComponent c,
               Object convertedObject, Map<String, Object> p) {

                 //...
                 return true;
             }

             public void afterValidation(
               FacesContext fC, UIComponent c,
               Object convertedObject, Map<String, Object> p) {

                 //...
             }
    }

24.03.2010               DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   19
Validation Interception - Example
• Usage
     • Global interceptors
             ExtValContext.getContext()
               .addPropertyValidationInterceptor(
                 new CustomInterceptor());
     • Local interceptors
             @Required(parameters = CustomInterceptor.class)
             private String name;




24.03.2010              DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   20
SkipValidationEvaluator
• Evaluates if the validation process for the
  current property should be skipped
• Allows to provide a custom evaluator




24.03.2010    DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   21
Optional Invocation Order
• Classes which implement an interface
  which is annotated with
  @InvocationOrderSupport
  are allowed to use
  @InvocationOrder
• The annotation allows to register artifacts
  which get called e.g. before internal
  artifacts
• Default order: 1000


24.03.2010    DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   22
Integration of RAD-Add-on
• It‘s possible to use input components
  without value-bindings.
• Use-Case:
  During prototyping sometimes developers
  have to create dummy pages without
  functionality.




24.03.2010   DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   23
Static Syntax for @JoinValidation
• In addition to the existing notations it‘s
  possible to refer a target property via
  the fully qualified class name
  + the property name
• Example:
    @JoinValidation("at.irian.demo.domain.Person:password")




24.03.2010         DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   24
Empty-/Null-Value Markers
• Marker for validation strategies instead of
  actively ignoring empty/null values
• Via Annotations
     • @EmptyValueAwareValidationStrategy
     • @NullValueAwareValidationStrategy




24.03.2010    DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   25
Other Improvements
• Structural improvements
• Performance improvements
• (JSF-) ProjectStage support




24.03.2010   DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   26
New Add-ons - 1
• Add-ons compatible with Property- and
  Bean-Validation module
      • Transactional model validation (light)
      • Continue with warnings
• Add-ons compatible with Property-
  Validation module
      • Advanced meta-data
      • Java based config
        (Syntax inspired by Google Guice)

24.03.2010        DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   27
New Add-ons - 2
• Bean-Validation module
      • Spring managed constraint validation
        (us dependency injection in custom constraint
        validator implementations)




24.03.2010        DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   28
Links
• http://svn.apache.org/repos/asf/myfaces/extensi
  ons/validator
• http://issues.apache.org/jira/browse/EXTVAL
• http://wiki.apache.org/myfaces/Extensions/Valid
  ator/Versions/Versions/UpgradeGuide
• http://os890.blogspot.com
• http://code.google.com/p/os890/source/browse/tr
  unk/java/web/jsf/extval
• http://people.apache.org/~gpetracek/myfaces/ex
  tval

24.03.2010    DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator   29

More Related Content

PDF
MyFaces Extensions Validator 1.x.2 News
PDF
MyFaces Extensions Validator Part 1 of 3
PDF
MyFaces CODI v0.9.0 News
PDF
MyFaces Extensions Validator r4 news
PDF
MyFaces Universe at ApacheCon
PDF
MyFaces CODI and JBoss Seam3 become Apache DeltaSpike
PDF
OpenWebBeans and DeltaSpike at ApacheCon
PDF
Apache DeltaSpike
MyFaces Extensions Validator 1.x.2 News
MyFaces Extensions Validator Part 1 of 3
MyFaces CODI v0.9.0 News
MyFaces Extensions Validator r4 news
MyFaces Universe at ApacheCon
MyFaces CODI and JBoss Seam3 become Apache DeltaSpike
OpenWebBeans and DeltaSpike at ApacheCon
Apache DeltaSpike

What's hot (20)

PDF
MyFaces CODI Conversations
PDF
Make JSF more type-safe with CDI and MyFaces CODI
PPTX
Security Architecture of the Java platform
PPTX
Security Аrchitecture of Тhe Java Platform
PDF
Introduction to java servlet 3.0 api javaone 2009
PDF
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
PDF
Going Native With The OSGi Service Layer - Sascha Zelzer
PDF
Arquillian in a nutshell
PDF
Defending against Java Deserialization Vulnerabilities
PPTX
Java 9 sneak peek
PDF
Exploiting Deserialization Vulnerabilities in Java
PPT
Apache Tomcat 7 by Filip Hanik
PDF
XNAT Case Study: DIAN QC Uploader
PDF
Glassfish An Introduction
PDF
PPT
XPages Workshop: Concepts And Exercises
PDF
Java Deserialization Vulnerabilities - The Forgotten Bug Class (DeepSec Edition)
PPTX
ASP.NET 4.0 Cache Extensibility
PDF
Advanced liferay architecture clustering and high availability
PDF
Architecting Large Enterprise Java Projects
MyFaces CODI Conversations
Make JSF more type-safe with CDI and MyFaces CODI
Security Architecture of the Java platform
Security Аrchitecture of Тhe Java Platform
Introduction to java servlet 3.0 api javaone 2009
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
Going Native With The OSGi Service Layer - Sascha Zelzer
Arquillian in a nutshell
Defending against Java Deserialization Vulnerabilities
Java 9 sneak peek
Exploiting Deserialization Vulnerabilities in Java
Apache Tomcat 7 by Filip Hanik
XNAT Case Study: DIAN QC Uploader
Glassfish An Introduction
XPages Workshop: Concepts And Exercises
Java Deserialization Vulnerabilities - The Forgotten Bug Class (DeepSec Edition)
ASP.NET 4.0 Cache Extensibility
Advanced liferay architecture clustering and high availability
Architecting Large Enterprise Java Projects
Ad

Viewers also liked (14)

PPTX
Persija jakarta
TXT
강남카지노 인터넷블랙잭
PDF
Preparing occupational therapy students to address clients mental health need...
TXT
강원랜드카지노 복권룰
PDF
Louisa rabanal,
DOCX
100474
PPTX
Persija jakarta
DOC
CURRICULUM VITAE
DOCX
100490
PDF
Taller 1 cálculo integral
PPT
[Segmedtrab] empresa como parte da sociedade a empresa como parte da sociedade
PDF
Такая вот штука для презентаций
PPTX
3 Neuropsychology Of Human Behaviour
PPT
Tympanometry & Clinical Applications
Persija jakarta
강남카지노 인터넷블랙잭
Preparing occupational therapy students to address clients mental health need...
강원랜드카지노 복권룰
Louisa rabanal,
100474
Persija jakarta
CURRICULUM VITAE
100490
Taller 1 cálculo integral
[Segmedtrab] empresa como parte da sociedade a empresa como parte da sociedade
Такая вот штука для презентаций
3 Neuropsychology Of Human Behaviour
Tympanometry & Clinical Applications
Ad

Similar to MyFaces Extensions Validator r3 News (15)

PDF
Declarative Input Validation with JSR 303 and ExtVal
PDF
Declarative input validation with JSR 303 and ExtVal
PDF
Java EE 7 Recipes
PDF
JSR-303 Bean Validation API
PDF
PDF
Neuerungen in JavaServer Faces 2.0
PPTX
Flexible validation with Hibernate Validator 5.x.
PPT
My journey to use a validation framework
PPTX
Best Practices for JSF, Gameduell 2013
PDF
Spring 3: What's New
PDF
18 Invaluable Lessons About ADF-JSF Interaction
PPTX
Introduction to JSF
PDF
JSRs 303 and 330 in Action
PPT
Jsf validation
PPT
Java Server Faces (JSF) - advanced
Declarative Input Validation with JSR 303 and ExtVal
Declarative input validation with JSR 303 and ExtVal
Java EE 7 Recipes
JSR-303 Bean Validation API
Neuerungen in JavaServer Faces 2.0
Flexible validation with Hibernate Validator 5.x.
My journey to use a validation framework
Best Practices for JSF, Gameduell 2013
Spring 3: What's New
18 Invaluable Lessons About ADF-JSF Interaction
Introduction to JSF
JSRs 303 and 330 in Action
Jsf validation
Java Server Faces (JSF) - advanced

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Machine learning based COVID-19 study performance prediction
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
KodekX | Application Modernization Development
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
Spectroscopy.pptx food analysis technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MYSQL Presentation for SQL database connectivity
Chapter 3 Spatial Domain Image Processing.pdf
Programs and apps: productivity, graphics, security and other tools
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine learning based COVID-19 study performance prediction
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Weekly Chronicles - August'25 Week I
KodekX | Application Modernization Development
sap open course for s4hana steps from ECC to s4
Big Data Technologies - Introduction.pptx
Understanding_Digital_Forensics_Presentation.pptx
The AUB Centre for AI in Media Proposal.docx

MyFaces Extensions Validator r3 News

  • 1. JSF in der Praxis 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 1
  • 2. MyFaces Extensions-Validator What’s new in version 3 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 2
  • 3. Agenda - 1 • Bean-Validation Integration Module (JSR 303 for JSF 1.x & 2.x + special Features) • Improved Support for 3rd Party Component Libraries • Typesafe Constraint Parameters • Constraint Severity • Pluggable Storages • Meta-Data Filters • Validation Interception 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 3
  • 4. Agenda - 2 • SkipValidationEvaluator • Optional Invocation Order • Integration of RAD-Add-on • Additional Static Syntax for @JoinValidation • Empty-/Null-Value Markers • Other Improvements • New Add-ons 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 4
  • 5. Bean-Validation Integration • JSR 303 for JSF 1.x and JSF 2.x • Integration Module as alternative/addition to the Property-Validation Module • Compatible with all BV conform implementations • Module provides additional features • Advantage: It’s the (new) standard • Disadvantage: Not all features of ExtVal will be available (due to spec. restrictions) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 5
  • 6. ExtVal vs. JSF 2 BV-Integration • With ExtVal • @NotNull validation enabled by default (deactivation via std. JSF config) • Typesafe group validation • No Validation Markup in the Page • The ExtValBeanValidationContext allows custom implementations e.g. tags, configs,… • Component initialization (e.g. @NotNull client-side required) • Severity aware validation 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 6
  • 7. ExtVal vs. JSF 2 BV-Integration • Model based validation • Sorted violation messages • Out-of-the-box dependency injection support for constraint-validators 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 7
  • 8. ExtVal Annotations for BV • @BeanValidation for Group-Validation • @ModelValidation class level validation of an explicit or implicit target 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 8
  • 9. @BeanValidation • Normally used in Page-Beans • Available attributes • viewIds (default: * for all pages) • useGroups (default: Default.class) • restrictGroups (default: -) • conditions (default: #{true}) • modelValidation (default: -) • List (equivalent to multi-constraint syntax of JSR 303) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 9
  • 10. @BeanValidation - Examples • Simple group validation @BeanValidation(useGroups=Admin.class) • Group validation for a specific view @BeanValidation(viewIds="/login.xhtml", useGroups=Admin.class) • If group validation is defined for the whole bean, it might be required to exclude groups for special properties and/or views @BeanValidation(restrictGroups=Admin.class) • Conditional group validation @BeanValidation(useGroups = Admin.class, conditions="#{user.role.privileged}") 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 10
  • 11. @ModelValidation • To trigger bean-validation after „Update model values" phase • Also uses information of @BeanValidation • Difference: @ModelValidation isn‘t accumulated • Available attributes • isActive (default: false) • displayInline (default: false) • validationTargets (default: current base object) • message (default: -) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 11
  • 12. 3rd Party Component Libraries • Improved support for • Trinidad • ICEfaces • RichFaces • New sandbox project e.g. for external component support modules to improve compatibility with 3rd party component libraries (http://code.google.com/p/sandbox890) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 12
  • 13. Typesafe Constraint Parameters • Similar to the payload-attribute of BV (Payload is the subset of Constraint Parameters of ExtVal) • Allows typesafe and reusable parameters • Simple example - alternative for: @MyConstraint(payload = "warn") With Bean-Validation: @MyConstraint(payload = Warn.class) • Processed by Add-ons or Component Libraries 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 13
  • 14. Constraint Severity • Constraints with Severity Info and Warn don‘t "stop" the JSF-Lifecycle • ExtVal 1.x.3 provides out-of-the-box • ViolationSeverity.Info.class • ViolationSeverity.Warn.class • ViolationSeverity.Error.class (= default) • ViolationSeverity.Fatal.class 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 14
  • 15. Optional: Pluggable Parameters • ExtVal allows to map custom classes to the default implementations (esp. to avoid dependencies of BV Constraints to ExtVal) • Mapping via • Global-ExtVal-Parameter • Static config • Examples are available in the ExtVal Wiki 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 15
  • 16. Pluggable Storages • Generic mechanism which provides scoped storages with custom APIs • Allows to create multiple storages of the same type with different names • Allows to create different storage types • StorageManager (per storage type) • Responsible for scoping • Allows to create and reset (custom) storages via an API (independent of the storage type) • Allows to provide custom (tweaked) storage implementations easily 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 16
  • 17. Meta-Data Filters • Filters meta-data before it gets added to the meta-data storage • Only for static meta-data manipulation • Meta-data extraction interceptors are only for dynamic meta-data manipulation 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 17
  • 18. Validation Interception - 1 • Invocation: • Global interceptors: before and after the validation of a property • Local interceptors: before and after the validation of a constraint • Allows to bypass validation of a • Property • Constraint 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 18
  • 19. Validation Interception - Example • Implementation public class CustomInterceptor implements PropertyValidationInterceptor { public boolean beforeValidation( FacesContext fC, UIComponent c, Object convertedObject, Map<String, Object> p) { //... return true; } public void afterValidation( FacesContext fC, UIComponent c, Object convertedObject, Map<String, Object> p) { //... } } 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 19
  • 20. Validation Interception - Example • Usage • Global interceptors ExtValContext.getContext() .addPropertyValidationInterceptor( new CustomInterceptor()); • Local interceptors @Required(parameters = CustomInterceptor.class) private String name; 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 20
  • 21. SkipValidationEvaluator • Evaluates if the validation process for the current property should be skipped • Allows to provide a custom evaluator 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 21
  • 22. Optional Invocation Order • Classes which implement an interface which is annotated with @InvocationOrderSupport are allowed to use @InvocationOrder • The annotation allows to register artifacts which get called e.g. before internal artifacts • Default order: 1000 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 22
  • 23. Integration of RAD-Add-on • It‘s possible to use input components without value-bindings. • Use-Case: During prototyping sometimes developers have to create dummy pages without functionality. 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 23
  • 24. Static Syntax for @JoinValidation • In addition to the existing notations it‘s possible to refer a target property via the fully qualified class name + the property name • Example: @JoinValidation("at.irian.demo.domain.Person:password") 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 24
  • 25. Empty-/Null-Value Markers • Marker for validation strategies instead of actively ignoring empty/null values • Via Annotations • @EmptyValueAwareValidationStrategy • @NullValueAwareValidationStrategy 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 25
  • 26. Other Improvements • Structural improvements • Performance improvements • (JSF-) ProjectStage support 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 26
  • 27. New Add-ons - 1 • Add-ons compatible with Property- and Bean-Validation module • Transactional model validation (light) • Continue with warnings • Add-ons compatible with Property- Validation module • Advanced meta-data • Java based config (Syntax inspired by Google Guice) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 27
  • 28. New Add-ons - 2 • Bean-Validation module • Spring managed constraint validation (us dependency injection in custom constraint validator implementations) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 28
  • 29. Links • http://svn.apache.org/repos/asf/myfaces/extensi ons/validator • http://issues.apache.org/jira/browse/EXTVAL • http://wiki.apache.org/myfaces/Extensions/Valid ator/Versions/Versions/UpgradeGuide • http://os890.blogspot.com • http://code.google.com/p/os890/source/browse/tr unk/java/web/jsf/extval • http://people.apache.org/~gpetracek/myfaces/ex tval 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 29