SlideShare uma empresa Scribd logo
1 de 46
Anghel LeonardConstantin Alin
OmniFaces
is an utility library for JSF
and a comprehensive
compendium of
programming techniques,
design patterns and
recipes for JSF developers.
Inside this book, you will learn how to write robust, reusable
and easy to maintain JSF code with a high level of readability, efficiency and performance.
• learn how to use OmniFaces artifacts in your JSF projects
• understand how OmniFaces/JSF is implemented and how it works internally
• exploit the JSF API at a high level of development
• explore and write JSF programming techniques and design patt erns
• develop JSF reusable code
• identify and fix JSF gaps, pitfalls and bugs
• increase your arsenal of JSF helpers with more than 300 utilities methods
• learn how to write a considerable number of JSF custom artifacts types
• push your JSF skills to the limit and become a cutt ing edge developer
• crumble JSF myths and misconceptions by deeply understanding the framework
Chapter 1 - OmniFaces Components
Chapter 2 - OmniFaces Validators
Chapter 3 - OmniFaces Tag Handlers
Chapter 4 - OmniFaces Converters
Chapter 5 - OmniFaces Exception Handlers
Chapter 6 - OmniFaces Exception Contexts
Chapter 7 - OmniFaces Resource Handlers
Chapter 8 - OmniFaces Event Listeners
Chapter 9 - OmniFaces View Handlers
Chapter 10 - There's More
• registering a custom component for listening PostRestoreStateEvent
• programmatically extracting the value of an attribute
• searching components using relative‐up/down search algorithm
• collect the value of the label attribute for the given UI component
• setting an attribute value as a literal or as a value expression
• instructing an UIComponent to support a JSF converter
• sample of extending the ValueHolder interface (ParamHolder)
• having a quick overview of how to use StateHelper class
• introducing static vs. dynamic converters
• temporarily replacing the default output response (ResponseWriter)
• working with attributes of type var
• suppress the invocation of setValueExpression() for an attribute
• replacing/restoring the ResponseWriter in the rendering process
• carrying an artifact via the FacesContext attributes map
• putting an artifact in the request map (scope)
• programmatically indicating the renderer of a component
• indicating that a component will render its children also
• understanding the triplet: encodeBegin(), encodeChildren(), encodeEnd()
• programmatically collecting the available messages – FacesMessages
• discovering the OmniFaces utility, findComponentsInChildren()
• storing/removing something in/from request scope (request map)
• replacing/restoring something from/in request scope (request map)
• "postponing"/triggering the rendering of a component
• programmatically generating the markup of a HTML table/list
• working with the @ListenerFor annotation
• rendering the <script/> element
• determining if the current request is/isn t an AJAX requestʹ
• determining if the value of the render attribute is @all
• programmatically subscribe to view events (e.g. PreRenderViewEvent)
• using the OmniPartialViewContext for executing the given scripts on
completion of the current AJAX response
• marking a resource as rendered
• programmatically creating a Resource
• rendering the <script/> element when a resource exist
• rendering the <script/> element when a resource does not exist
• working with JSF VisitTree API
• access, from JS, the HTML markup via the client IDs provided by JSF
• transforming a stateful component into a stateless component
• suppressing decoding and validation at postback requests
• suppressing the built‐in required validator
• using the name attribute when the label attribute is absent
• working with the OmniFaces utility, MapWrapper
• working with several OmniFaces utility methods
• writing a custom FacesContext, Application and ViewHandler
• working with ViewHandler#getActionURL()
• encoding URLs
• programmatically control Process Validations phase
(via processValidators()) and Update Model Values
phase (via processUpdates())
• subscribing with a Callback to after Restore View phase
• a good example for understanding the JSF lifecycle
• JSF post‐processing tips
• subscribing with Callbacks to view/phase events
• working with BufferedHttpServletResponse
• introducing TagHandlers
• working with VariableMapper
• overriding UIComponent#isVisitable()
• programmatically loading the JSF AJAX library
• writing a custom UICommand
• extracting all UIParameters nested in a certain component
• validating if a component has a parent of a certain type
• resolve the given space separated collection of relative client IDs to
absolute client IDs
• creating and queuing an ActionEvent
• adding the autorun feature
• introducing “facelet scope”
• passing FaceletContext to a custom UIComponent
• storing a ValueExpression in the “facelet scope”
• storing a UIComponent in request scope
• subscribing to PreRenderViewEvent and PostRestoreStateEvent
• writing a custom ValueExpression
• working with ReadOnlyValueExpression
• writing a functional Callback
• finding a component in the component tree by client ID
• working with OmniFaces, validateHasNoChildren() utility method
• obtaining the environment‐specific object instance for
the current request/response
• building a buffered response via OmniFaces,
BufferedHttpServletResponse using the Servlets API RequestDispatcher
to includes the content of a resource
• understanding how JSF processes images
• working with JSF resource handlers
• writing a cacheable dynamic resource
• working with images request path
• understanding how “last modified” works
• obtaining/determining image content type
• obtaining the data URI from an image
• parsing/evaluating a ValueExpression and store
• converting a ValueExpression into a request path eligible for Reflection API
• parsing a request path and invoking a method using Java Reflection API
• testing the presence of an annotation on a class
• converting strings to objects using converters registered on given types
• converting objects to strings using converters registered on given types
• extending ViewParam
• processing request query parameters
• understanding decode() method goal
• suppressing validations and data model updates
• writing a custom PhaseListener
• learning about quick succession of writings
• turn off/on the original response writer
• moving components in the component tree
• moving facets and behaviors
• understanding how behaviors works in JSF
• implementing ClientBehaviorHolder
• subscribing to PreRenderViewEvent, and PostAddToViewEvent
• exploring several Tree use cases
• controlling the processDecodes(), processValidators(),
processUpdates() and the encodeChildren() from a single place (TreeFamily)
• using a "bunch" of OmniFaces utilities which are very handy in day
by day development
• following the JSF flow in a recursive implementation
• working with the "special" attributes, var and varNode
• exploring how the events are queued and broadcasted
• introducing javax.faces.FACELETS_SKIP_COMMENTS
• understanding the escape attribute role
• defining a Java reserved word as an enum item
• introducing Bean Validation
• obtaining the default message interpolator
• customizing the default message interpolator
• writing a template validator
• writing a template converter
• check if a component supports validators/converters
(is an instance of EditableValueHolder)
• programmatically obtain the model value of a component
• explicitly invoke the converter getAsString() method
• implement a custom validator
• programmatically check a component type
• programmatically locate a message bundle and access its keys
• implement a validator as a TagHander
• what s a JSFʹ new component in the component tree
• get the value of an attribute as a ValueExpression to be carried around and
evaluated later in the lifecycle without needing the Facelet context
• postpone a task before/after a JSF lifecycle phase of the current request
• get the closest parent of the given parent type
• write a SystemEventListener for PreValidateEvent and PostValidateEvent
• fired by UIInputs that have attached a BeanValidator
• finding a certain validator in the list of validators of a component
• programmatically point/replace/restore the BeanValidator validation groups
• use OmniFaces Copier API for copying objects
• traverse a form children and extract the ValueReference of each
EditableValueHolder for the specified base
• implementing a custom validator as a TagHandler that is registered as a
listener for ValueChangeEvent
• ValueChangeEvent internal overview
• JSF VisitTree implementation sample ‐ visit a JSF table rows (UIData iteration)
• tips for collecting the values of an UIInput component in an UIData component
• signaling invalid values
• "intercepting" Apply Request Values phase via processDecodes() method
• "intercepting" Process Validators phase via processValidators() method
• "intercepting" Update Model phase via processUpdates() method
• collecting inputs (and their values) from a form
• marking invalidation at component/context level
• associating the message bundle keys with components COMPONENT_TYPEs
• programmatically accessing an annotation (e.g. @FacesComponent)
• programmatically accessing message bundle
• writing a component handler, and access ValueExpressions/MethodExpressions
representing the values of attributes of the component
• "ugly" , but functional, approach for distinguishing between a
ValueExpression and a MethodExpression
• evaluating a ValueExpression
• invoking the method indicated via MethodExpression
• introducing JSF converters/validators handlers
• exposing the TagHandler protected methods as public methods
• using binding and converterId/validatorId attributes to instantiate a
certain converter/validator
• collecting values of attributes as ValueExpressions
• using the java.beans.Introspector API to identify the setters of a bean
• wiring attributes values with corresponding setters (literal text and
deferred value expressions)
• using Java Reflection API to invoke setters
• storing deferred value expressions and setters in a Map
• creating and using an anonymous Converter/Validator
• exploiting several features of Java Reflection API
• creating and working with a cache based on
the java.util.concurrent.ConcurrentHashMap
• storing entries in request scope
• working with Facelet scope
• collecting the values of the var and type attributes
• writing a validation handler via a tag handler "local" (via UIInput#isValid())
and "global" (via FacesContext#validationFailed()) validation
• programmatically redirecting and sending HTTP status error code
• subscribing the given Callback instance to the given component that get
invoked only in the current request when the given component system
event type is published on the given component
• collecting messages from faces messages list
• add a message in flash scope
• avoid the Faces message has been enqueued but is not displayed warning
• evaluating the given value expression as a string
• understanding the ViewExpiredException
• understanding the view restoring process
• writing a custom view handler
• creating a new view via ViewHandler#createView()
• building a view via ViewDeclarationLanguage#buildView()
• writing a custom FacesContext
• programmatically attaching/detaching a custom FacesContext
• obtaining the view associated render kit
• checking at runtime the required attributes
via TagHandler#getRequiredAttribute()
• working with TagHandler#nextHandler field
• programmatically setting an attribute of a component
• great lesson about EL API
• wrapping a ValueExpression into a MethodExpression
• developing a custom ELContext
• developing a custom ELResolver
• working with VariableMapper
• working with Facelets files
• introducing Facelet context (e.g. DefaultFaceletContext)
• introducing VariableMapper (e.g. VariableMapperWrapper)
• understanding how Facelets files are processed by JSF
• writing and setting a custom VariableMapper (DelegatingVariableMapper)
• writing a custom EnumConverter
• capturing the enum type in getAsString()
• storing/accessing the enum type in/from view map
• introducing SelectItem, SelectItemGroup, UISelectItem and UISelectItems API
• extracting all SelectItem expressed via UISelectItem and UISelectItems
• learning the algorithm expressed by a UISelectItems component that
uses the var iterator construct to generate a list of SelectItems
• working with OmniFaces, ScopedRunner
• iterating SelectItemGroup
• working with FacesContext attributes
• extracting unhandled exceptions
• handling AbortProcessingException
• locating error pages in web.xml
• programmatically creating and rendering a new view
• accessing unhandled exceptions
• turning each exception into a global FATAL faces message
• extending the PartialViewContext
• “dissecting” the partial rendering response
• understanding how a partial response is rendered via PartialResponseWriter
• writing a custom PartialResponseWriter
• altering the partial response content
• using and understanding <eval> tag
• understanding how Mojarra and MyFaces are working with partial response
• programmatically inspecting the web.xml file
• check if the web.xml security constraint has been triggered
during this AJAX request
• resetting and closing the AJAX response
• fortify your knowledge about the JSF ResourceHandler and Resource APIs
• working with the OmniFaces DefaultResourceHandler API
• collecting the context parameters from web.xml/web-fragment.xml
• replacing a resource request path
• using the Application#evaluateExpressionGet()
• introducing the OmniFaces RemappedResource
• replacing the mapping prefix/suffix of the original generated request path
• understanding the isResourceRequest() and handleResourceRequest()
• recognizing PrimeFaces dynamic resource requests
• collecting component resources by their type
• hacking RichFaces 4 component resources
• combining multiple component resources in a single one
• using server‐side cache for the combined component resources
• determining the render type for a component resource
• sequentially serving multiple resources
• modifying an existing component resource
• creating a new component resource
• understanding how <f:event> works
• adding support for new <f:event> types (preInvokeAction and postInvokeAction)
• writing a custom phase listener
• subscribing a phase listener to other events (e.g. PostValidateEvent)
• collecting components that have certain registered listener
• introducing the OmniFaces, DefaultPhaseListener
• writing an artifact that can act as an action listener or as a phase listener
• using processAction(ActionEvent) method
• getting partial executing/rendering IDs
• introducing built‐in, resetValue()
• chaining action listeners invocation
• seeing another useful Visit Tree API implementation
• introducing JSF auto‐generated IDs
• writing a custom view handler
• checking the project stage
• writing a custom ResponseWriter
• overriding ResponseWriter#cloneWithWriter()
• distinguish between "normal" IDs and "special" IDs
(e.g. view state and client window IDs)
• brief overview of other OmniFaces artifacts
• what's new in OmniFaces 3.0

Mais conteúdo relacionado

Mais procurados

Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsSrikanth Shenoy
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web ApplicationYakov Fain
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UITech OneStop
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Tech OneStop
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFXHendrik Ebbers
 
Request Validation In Spring Rest-Part2
Request Validation In Spring Rest-Part2Request Validation In Spring Rest-Part2
Request Validation In Spring Rest-Part2Mohammad Sabir Khan
 
JSF basics
JSF basicsJSF basics
JSF basicsairbo
 
RichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF ApplicationsRichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF ApplicationsMax Katz
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise Group
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics TutorialClever Moe
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design PatternsLilia Sfaxi
 
JavaFX8 TestFX - CDI
JavaFX8   TestFX - CDIJavaFX8   TestFX - CDI
JavaFX8 TestFX - CDISven Ruppert
 

Mais procurados (20)

Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
 
Spring REST Request Validation
Spring REST Request ValidationSpring REST Request Validation
Spring REST Request Validation
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFX
 
Java Custom Annotations- Part1
Java Custom Annotations- Part1Java Custom Annotations- Part1
Java Custom Annotations- Part1
 
Spring core
Spring coreSpring core
Spring core
 
Request Validation In Spring Rest-Part2
Request Validation In Spring Rest-Part2Request Validation In Spring Rest-Part2
Request Validation In Spring Rest-Part2
 
JSF basics
JSF basicsJSF basics
JSF basics
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring aop
Spring aopSpring aop
Spring aop
 
Spring jdbc
Spring jdbcSpring jdbc
Spring jdbc
 
RichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF ApplicationsRichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF Applications
 
OLT open script
OLT open script OLT open script
OLT open script
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 training
 
Maven
MavenMaven
Maven
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
JavaFX8 TestFX - CDI
JavaFX8   TestFX - CDIJavaFX8   TestFX - CDI
JavaFX8 TestFX - CDI
 

Destaque

ry_aviary-socialstrategy(ty)
ry_aviary-socialstrategy(ty)ry_aviary-socialstrategy(ty)
ry_aviary-socialstrategy(ty)Richard A. Yumang
 
¿QUE ES UN PROYECTO, CUALES SON SUS COMPONENTES Y CÓMO SE HACE EL INFORME?
¿QUE ES UN PROYECTO, CUALES SON SUS COMPONENTES Y CÓMO SE HACE EL INFORME?¿QUE ES UN PROYECTO, CUALES SON SUS COMPONENTES Y CÓMO SE HACE EL INFORME?
¿QUE ES UN PROYECTO, CUALES SON SUS COMPONENTES Y CÓMO SE HACE EL INFORME?Leonardo Torres
 
Diary Development corporation, Biratnagar
Diary Development corporation, BiratnagarDiary Development corporation, Biratnagar
Diary Development corporation, BiratnagarHome
 
Nepal earthquake
Nepal earthquakeNepal earthquake
Nepal earthquakeHome
 
If you can't beat em, join em
If you can't beat em, join emIf you can't beat em, join em
If you can't beat em, join emJohn Eberhardt
 
DSS-Literally Litter Free
DSS-Literally Litter Free DSS-Literally Litter Free
DSS-Literally Litter Free Farhan Karim
 

Destaque (15)

Cult Mix Athens
Cult Mix AthensCult Mix Athens
Cult Mix Athens
 
Netbeans :)
Netbeans :)Netbeans :)
Netbeans :)
 
ry_aviary-socialstrategy(ty)
ry_aviary-socialstrategy(ty)ry_aviary-socialstrategy(ty)
ry_aviary-socialstrategy(ty)
 
Ejercicios de klapp
Ejercicios de klappEjercicios de klapp
Ejercicios de klapp
 
¿QUE ES UN PROYECTO, CUALES SON SUS COMPONENTES Y CÓMO SE HACE EL INFORME?
¿QUE ES UN PROYECTO, CUALES SON SUS COMPONENTES Y CÓMO SE HACE EL INFORME?¿QUE ES UN PROYECTO, CUALES SON SUS COMPONENTES Y CÓMO SE HACE EL INFORME?
¿QUE ES UN PROYECTO, CUALES SON SUS COMPONENTES Y CÓMO SE HACE EL INFORME?
 
Uc2907 dw
Uc2907 dwUc2907 dw
Uc2907 dw
 
Diary Development corporation, Biratnagar
Diary Development corporation, BiratnagarDiary Development corporation, Biratnagar
Diary Development corporation, Biratnagar
 
Bestram Engargolado
Bestram EngargoladoBestram Engargolado
Bestram Engargolado
 
Nepal earthquake
Nepal earthquakeNepal earthquake
Nepal earthquake
 
If you can't beat em, join em
If you can't beat em, join emIf you can't beat em, join em
If you can't beat em, join em
 
Cure of Gingivits
Cure of GingivitsCure of Gingivits
Cure of Gingivits
 
CATALOGUE ENG
CATALOGUE ENGCATALOGUE ENG
CATALOGUE ENG
 
works
worksworks
works
 
DSS-Literally Litter Free
DSS-Literally Litter Free DSS-Literally Litter Free
DSS-Literally Litter Free
 
Publicación8
Publicación8Publicación8
Publicación8
 

Semelhante a Mastering OmniFaces - A Problem to Solution Approach

Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)Fahad Golra
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJosh Juneau
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Rohit Kelapure
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfAlfresco Software
 
WinAppDriver Development
WinAppDriver DevelopmentWinAppDriver Development
WinAppDriver DevelopmentJeremy Kao
 
Spring 3 - An Introduction
Spring 3 - An IntroductionSpring 3 - An Introduction
Spring 3 - An IntroductionThorsten Kamann
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack ImplementationMert Çalışkan
 
SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...Liam Cleary [MVP]
 
Mastering react with redux
Mastering react with reduxMastering react with redux
Mastering react with reduxGaurav Singh
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfAlfresco Software
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfAlfresco Software
 
Web Technologies in Java EE 7
Web Technologies in Java EE 7Web Technologies in Java EE 7
Web Technologies in Java EE 7Lukáš Fryč
 
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...
Enhance existing REST APIs  (e.g. Facebook Graph API) with code completion us...Enhance existing REST APIs  (e.g. Facebook Graph API) with code completion us...
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...johannes_fiala
 

Semelhante a Mastering OmniFaces - A Problem to Solution Approach (20)

JSF2
JSF2JSF2
JSF2
 
Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring Surf
 
WinAppDriver Development
WinAppDriver DevelopmentWinAppDriver Development
WinAppDriver Development
 
Spring 3 - An Introduction
Spring 3 - An IntroductionSpring 3 - An Introduction
Spring 3 - An Introduction
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
 
SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...
 
Mastering react with redux
Mastering react with reduxMastering react with redux
Mastering react with redux
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
Unit4wt
Unit4wtUnit4wt
Unit4wt
 
Web Technologies in Java EE 7
Web Technologies in Java EE 7Web Technologies in Java EE 7
Web Technologies in Java EE 7
 
Andrei shakirin rest_cxf
Andrei shakirin rest_cxfAndrei shakirin rest_cxf
Andrei shakirin rest_cxf
 
Eclipse e4
Eclipse e4Eclipse e4
Eclipse e4
 
Unit4wt
Unit4wtUnit4wt
Unit4wt
 
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...
Enhance existing REST APIs  (e.g. Facebook Graph API) with code completion us...Enhance existing REST APIs  (e.g. Facebook Graph API) with code completion us...
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...
 

Último

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Último (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

Mastering OmniFaces - A Problem to Solution Approach

  • 1. Anghel LeonardConstantin Alin OmniFaces is an utility library for JSF and a comprehensive compendium of programming techniques, design patterns and recipes for JSF developers.
  • 2. Inside this book, you will learn how to write robust, reusable and easy to maintain JSF code with a high level of readability, efficiency and performance. • learn how to use OmniFaces artifacts in your JSF projects • understand how OmniFaces/JSF is implemented and how it works internally • exploit the JSF API at a high level of development • explore and write JSF programming techniques and design patt erns • develop JSF reusable code • identify and fix JSF gaps, pitfalls and bugs • increase your arsenal of JSF helpers with more than 300 utilities methods • learn how to write a considerable number of JSF custom artifacts types • push your JSF skills to the limit and become a cutt ing edge developer • crumble JSF myths and misconceptions by deeply understanding the framework
  • 3. Chapter 1 - OmniFaces Components Chapter 2 - OmniFaces Validators Chapter 3 - OmniFaces Tag Handlers Chapter 4 - OmniFaces Converters Chapter 5 - OmniFaces Exception Handlers Chapter 6 - OmniFaces Exception Contexts Chapter 7 - OmniFaces Resource Handlers Chapter 8 - OmniFaces Event Listeners Chapter 9 - OmniFaces View Handlers Chapter 10 - There's More
  • 4. • registering a custom component for listening PostRestoreStateEvent • programmatically extracting the value of an attribute • searching components using relative‐up/down search algorithm • collect the value of the label attribute for the given UI component • setting an attribute value as a literal or as a value expression
  • 5. • instructing an UIComponent to support a JSF converter • sample of extending the ValueHolder interface (ParamHolder) • having a quick overview of how to use StateHelper class • introducing static vs. dynamic converters • temporarily replacing the default output response (ResponseWriter)
  • 6. • working with attributes of type var • suppress the invocation of setValueExpression() for an attribute • replacing/restoring the ResponseWriter in the rendering process • carrying an artifact via the FacesContext attributes map • putting an artifact in the request map (scope)
  • 7. • programmatically indicating the renderer of a component • indicating that a component will render its children also • understanding the triplet: encodeBegin(), encodeChildren(), encodeEnd() • programmatically collecting the available messages – FacesMessages • discovering the OmniFaces utility, findComponentsInChildren() • storing/removing something in/from request scope (request map) • replacing/restoring something from/in request scope (request map) • "postponing"/triggering the rendering of a component • programmatically generating the markup of a HTML table/list
  • 8. • working with the @ListenerFor annotation • rendering the <script/> element • determining if the current request is/isn t an AJAX requestʹ • determining if the value of the render attribute is @all • programmatically subscribe to view events (e.g. PreRenderViewEvent) • using the OmniPartialViewContext for executing the given scripts on completion of the current AJAX response
  • 9. • marking a resource as rendered • programmatically creating a Resource • rendering the <script/> element when a resource exist • rendering the <script/> element when a resource does not exist
  • 10. • working with JSF VisitTree API • access, from JS, the HTML markup via the client IDs provided by JSF
  • 11. • transforming a stateful component into a stateless component • suppressing decoding and validation at postback requests • suppressing the built‐in required validator • using the name attribute when the label attribute is absent • working with the OmniFaces utility, MapWrapper
  • 12. • working with several OmniFaces utility methods • writing a custom FacesContext, Application and ViewHandler • working with ViewHandler#getActionURL() • encoding URLs • programmatically control Process Validations phase (via processValidators()) and Update Model Values phase (via processUpdates()) • subscribing with a Callback to after Restore View phase • a good example for understanding the JSF lifecycle
  • 13. • JSF post‐processing tips • subscribing with Callbacks to view/phase events • working with BufferedHttpServletResponse • introducing TagHandlers • working with VariableMapper • overriding UIComponent#isVisitable()
  • 14. • programmatically loading the JSF AJAX library • writing a custom UICommand • extracting all UIParameters nested in a certain component • validating if a component has a parent of a certain type • resolve the given space separated collection of relative client IDs to absolute client IDs • creating and queuing an ActionEvent • adding the autorun feature
  • 15. • introducing “facelet scope” • passing FaceletContext to a custom UIComponent • storing a ValueExpression in the “facelet scope” • storing a UIComponent in request scope • subscribing to PreRenderViewEvent and PostRestoreStateEvent • writing a custom ValueExpression • working with ReadOnlyValueExpression • writing a functional Callback • finding a component in the component tree by client ID
  • 16. • working with OmniFaces, validateHasNoChildren() utility method • obtaining the environment‐specific object instance for the current request/response • building a buffered response via OmniFaces, BufferedHttpServletResponse using the Servlets API RequestDispatcher to includes the content of a resource
  • 17. • understanding how JSF processes images • working with JSF resource handlers • writing a cacheable dynamic resource • working with images request path • understanding how “last modified” works • obtaining/determining image content type • obtaining the data URI from an image • parsing/evaluating a ValueExpression and store • converting a ValueExpression into a request path eligible for Reflection API • parsing a request path and invoking a method using Java Reflection API • testing the presence of an annotation on a class • converting strings to objects using converters registered on given types • converting objects to strings using converters registered on given types
  • 18. • extending ViewParam • processing request query parameters • understanding decode() method goal • suppressing validations and data model updates • writing a custom PhaseListener • learning about quick succession of writings • turn off/on the original response writer
  • 19. • moving components in the component tree • moving facets and behaviors • understanding how behaviors works in JSF • implementing ClientBehaviorHolder • subscribing to PreRenderViewEvent, and PostAddToViewEvent
  • 20. • exploring several Tree use cases • controlling the processDecodes(), processValidators(), processUpdates() and the encodeChildren() from a single place (TreeFamily) • using a "bunch" of OmniFaces utilities which are very handy in day by day development • following the JSF flow in a recursive implementation • working with the "special" attributes, var and varNode • exploring how the events are queued and broadcasted
  • 21. • introducing javax.faces.FACELETS_SKIP_COMMENTS • understanding the escape attribute role • defining a Java reserved word as an enum item
  • 22. • introducing Bean Validation • obtaining the default message interpolator • customizing the default message interpolator
  • 23. • writing a template validator • writing a template converter • check if a component supports validators/converters (is an instance of EditableValueHolder) • programmatically obtain the model value of a component • explicitly invoke the converter getAsString() method
  • 24. • implement a custom validator • programmatically check a component type • programmatically locate a message bundle and access its keys
  • 25. • implement a validator as a TagHander • what s a JSFʹ new component in the component tree • get the value of an attribute as a ValueExpression to be carried around and evaluated later in the lifecycle without needing the Facelet context • postpone a task before/after a JSF lifecycle phase of the current request • get the closest parent of the given parent type • write a SystemEventListener for PreValidateEvent and PostValidateEvent • fired by UIInputs that have attached a BeanValidator • finding a certain validator in the list of validators of a component • programmatically point/replace/restore the BeanValidator validation groups • use OmniFaces Copier API for copying objects • traverse a form children and extract the ValueReference of each EditableValueHolder for the specified base
  • 26. • implementing a custom validator as a TagHandler that is registered as a listener for ValueChangeEvent • ValueChangeEvent internal overview • JSF VisitTree implementation sample ‐ visit a JSF table rows (UIData iteration) • tips for collecting the values of an UIInput component in an UIData component • signaling invalid values
  • 27. • "intercepting" Apply Request Values phase via processDecodes() method • "intercepting" Process Validators phase via processValidators() method • "intercepting" Update Model phase via processUpdates() method • collecting inputs (and their values) from a form • marking invalidation at component/context level • associating the message bundle keys with components COMPONENT_TYPEs • programmatically accessing an annotation (e.g. @FacesComponent) • programmatically accessing message bundle • writing a component handler, and access ValueExpressions/MethodExpressions representing the values of attributes of the component • "ugly" , but functional, approach for distinguishing between a ValueExpression and a MethodExpression • evaluating a ValueExpression • invoking the method indicated via MethodExpression
  • 28. • introducing JSF converters/validators handlers • exposing the TagHandler protected methods as public methods • using binding and converterId/validatorId attributes to instantiate a certain converter/validator • collecting values of attributes as ValueExpressions • using the java.beans.Introspector API to identify the setters of a bean • wiring attributes values with corresponding setters (literal text and deferred value expressions) • using Java Reflection API to invoke setters • storing deferred value expressions and setters in a Map • creating and using an anonymous Converter/Validator
  • 29. • exploiting several features of Java Reflection API • creating and working with a cache based on the java.util.concurrent.ConcurrentHashMap • storing entries in request scope • working with Facelet scope • collecting the values of the var and type attributes
  • 30. • writing a validation handler via a tag handler "local" (via UIInput#isValid()) and "global" (via FacesContext#validationFailed()) validation • programmatically redirecting and sending HTTP status error code • subscribing the given Callback instance to the given component that get invoked only in the current request when the given component system event type is published on the given component • collecting messages from faces messages list • add a message in flash scope • avoid the Faces message has been enqueued but is not displayed warning • evaluating the given value expression as a string
  • 31. • understanding the ViewExpiredException • understanding the view restoring process • writing a custom view handler • creating a new view via ViewHandler#createView() • building a view via ViewDeclarationLanguage#buildView() • writing a custom FacesContext • programmatically attaching/detaching a custom FacesContext • obtaining the view associated render kit
  • 32. • checking at runtime the required attributes via TagHandler#getRequiredAttribute() • working with TagHandler#nextHandler field • programmatically setting an attribute of a component
  • 33. • great lesson about EL API • wrapping a ValueExpression into a MethodExpression • developing a custom ELContext • developing a custom ELResolver • working with VariableMapper
  • 34. • working with Facelets files • introducing Facelet context (e.g. DefaultFaceletContext) • introducing VariableMapper (e.g. VariableMapperWrapper) • understanding how Facelets files are processed by JSF • writing and setting a custom VariableMapper (DelegatingVariableMapper)
  • 35. • writing a custom EnumConverter • capturing the enum type in getAsString() • storing/accessing the enum type in/from view map
  • 36. • introducing SelectItem, SelectItemGroup, UISelectItem and UISelectItems API • extracting all SelectItem expressed via UISelectItem and UISelectItems • learning the algorithm expressed by a UISelectItems component that uses the var iterator construct to generate a list of SelectItems • working with OmniFaces, ScopedRunner • iterating SelectItemGroup • working with FacesContext attributes
  • 37. • extracting unhandled exceptions • handling AbortProcessingException • locating error pages in web.xml • programmatically creating and rendering a new view
  • 38. • accessing unhandled exceptions • turning each exception into a global FATAL faces message
  • 39. • extending the PartialViewContext • “dissecting” the partial rendering response • understanding how a partial response is rendered via PartialResponseWriter • writing a custom PartialResponseWriter • altering the partial response content • using and understanding <eval> tag • understanding how Mojarra and MyFaces are working with partial response • programmatically inspecting the web.xml file • check if the web.xml security constraint has been triggered during this AJAX request • resetting and closing the AJAX response
  • 40. • fortify your knowledge about the JSF ResourceHandler and Resource APIs • working with the OmniFaces DefaultResourceHandler API • collecting the context parameters from web.xml/web-fragment.xml • replacing a resource request path • using the Application#evaluateExpressionGet() • introducing the OmniFaces RemappedResource
  • 41. • replacing the mapping prefix/suffix of the original generated request path • understanding the isResourceRequest() and handleResourceRequest() • recognizing PrimeFaces dynamic resource requests
  • 42. • collecting component resources by their type • hacking RichFaces 4 component resources • combining multiple component resources in a single one • using server‐side cache for the combined component resources • determining the render type for a component resource • sequentially serving multiple resources • modifying an existing component resource • creating a new component resource
  • 43. • understanding how <f:event> works • adding support for new <f:event> types (preInvokeAction and postInvokeAction) • writing a custom phase listener • subscribing a phase listener to other events (e.g. PostValidateEvent) • collecting components that have certain registered listener • introducing the OmniFaces, DefaultPhaseListener
  • 44. • writing an artifact that can act as an action listener or as a phase listener • using processAction(ActionEvent) method • getting partial executing/rendering IDs • introducing built‐in, resetValue() • chaining action listeners invocation • seeing another useful Visit Tree API implementation
  • 45. • introducing JSF auto‐generated IDs • writing a custom view handler • checking the project stage • writing a custom ResponseWriter • overriding ResponseWriter#cloneWithWriter() • distinguish between "normal" IDs and "special" IDs (e.g. view state and client window IDs)
  • 46. • brief overview of other OmniFaces artifacts • what's new in OmniFaces 3.0