And since bookmarks link to specific views, so must view parameters.As you may have guessed, view parameters are view-oriented.View parameters are far more adequate and robust in contrast.Pertaining to the topic in this article, view parameters are the key to bringing bookmarkable support to JSF.Here's a simple example of a view parameter that maps the value of a request parameter named But wait, there's more!The value of the request parameter is first converted and validated before being assigned to the model property. That's because it mirrors the processing of form input bindings on a faces request.You are going to find out how useful this bi-directionality can be later on in the article.Suffice to say, while the property mapping in the managed bean definition works, it's pretty anemic.
Since view parameters are a mapping to a Java Bean-style property, the value can be read from the property and propagated to the next request using either the query string or the UI component tree state (depending on the type of request).
They are also features for which the JSF community has passionately pleaded.
Read the other parts in this article series: Part 1 - JSF 2: Seam's Other Avenue to Standardization Part 2 - JSF 2 GETs Bookmarkable URLs Part 3 - Fluent Navigation in JSF 2 Part 4 - Ajax and JSF, Joined At Last Part 5 - Introducing JSF 2 Client Behaviors Every user session must start somewhere.
The complete view parameter life cycle is covered later when we look at view parameter propagation Before going any further, it's important to point out that view parameters are only available when using the new View Declaration Language (VDL), a standardized version of Facelets.
The primary reason is because the JSR-314 EG agreed that no new features should be made to support JSP since it's deprecated as a view handler in JSF 2. If you are savvy JSF developer, you're perhaps aware that it's already possible to map a request parameter value to a model property.