Skip to content

Commit f03f23b

Browse files
committed
Some more work on the migration guide
1 parent aba3b3d commit f03f23b

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

‎documentation/src/main/asciidoc/migration/prettyfaces3.asciidoc‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,62 @@ public Configuration getConfiguration(ServletContext context) {
209209
}
210210
|===
211211
212+
===== Path Parameters
213+
214+
[cols="1a,1a", options="header"]
215+
|===
216+
|PrettyFaces
217+
|Rewrite
218+
|
219+
----
220+
<url-mapping id="viewCategory">
221+
<pattern value="/store/#{category}/" />
222+
<view-id value="/faces/shop/store.jsf" />
223+
</url-mapping>
224+
----
225+
|
226+
----
227+
.addRule(
228+
Join.path("/store/{category}/").to("/faces/shop/store.jsf")
229+
)
230+
|===
231+
232+
[cols="1a,1a", options="header"]
233+
|===
234+
|PrettyFaces
235+
|Rewrite
236+
|
237+
----
238+
<url-mapping id="viewCategory">
239+
<pattern value="/store/#{bean.category}/" />
240+
<view-id value="/faces/shop/store.jsf" />
241+
</url-mapping>
242+
----
243+
|
244+
----
245+
.addRule(
246+
Join.path("/store/{category}/").to("/faces/shop/store.jsf")
247+
).where("category").bindsTo(El.property("bean.category"))
248+
|===
249+
250+
If your bean uses a JSF-specifc scope like +@ViewScoped+), you have to wrap
251+
the +El+ binding in a +PhaseBinding+. This will tell PrettyFaces to submit the
252+
binding in the specified JSF phase which ensures, that the scope of the bean will
253+
be active.
254+
255+
So instead of:
256+
257+
----
258+
.bindsTo(El.property("bean.category"))
259+
----
260+
261+
You have to write:
262+
263+
----
264+
.bindsTo(PhaseBinding.to(El.property("bean.category"))).after(PhaseId.RESTORE_VIEW))
265+
----
266+
267+
212268
TODO: describe all the other cases.
213269
214270
==== PrettyFaces Annotations

0 commit comments

Comments
 (0)