ocpsoft/rewrite — pull request #14 by fabmars (2012-03-19 00:59:45+00:00)
Title: Allow ElProperty binding during the JSF lifecycle (also while CDI contexts are active).

Short explanation: after I hacked PhaseBinding with an usage close to this of PhaseAction, I thought that was counter intuitive, and I decided to add an extra RewriteProvider within integration-faces with a lower priority than the http one, where operations are encapsulated within DeferredOperation instances and stacked in the request. RewritePhaseListener is modified to unwrap and trigger perform during the right phase. Tested with a sample project.

Usage: either wrap the binding using PhaseBinding#withhold, and it's
also possible to decide in which jsf phase the binding will be
eventually performed with #tillBefore or #tillAfter
Example config: ConfigurationBuilder.begin()
.addRule(Join.path("/blog/entry/{id}/").to("/blogView.jsf").where("id").bindsTo(PhaseBinding.withhold(El.property("blogEntryHandler.id")).tillBefore(PhaseId.INVOKE_APPLICATION)))

or directly use the BindingBuilder and the phase will be RESTORE_VIEW /
After
Example config: ConfigurationBuilder.begin()
.addRule(Join.path("/article/id/{id}/").to("/articleView.jsf").where("id").bindsTo(El.property("articleHandler.id")))