shale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Shale Wiki] Update of "ViewControllerMapper" by ReneZanner
Date Thu, 27 Jul 2006 19:28:43 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Shale Wiki" for change notification.

The following page has been changed by ReneZanner:

The comment on the change is:
added more information on purpose and providing a custom implementation

- === Default ===
+ == Purpose ==
-  * !DefaultViewControllerMapper [
+ To support the !ViewController pattern Shale provides a mechanism for automatic 1:1 association
of managed beans with JSF views. The [
ViewControllerMapper] interface provides the mapping between a given JSF view id and managed
bean name in your faces-config.xml (maybe you've already seen those warnings "No !ViewController
found for view id ..."). (For details on the !ViewController pattern look into the [
- === Custom ===
+ == Default Implementation ==
-  *
+ The !DefaultViewControllerMapper maps view ids to managed bean names as documented in it's
+ '''ATTENTION:''' When your view ids have dots in it's name (e.g. ""),
the resulting managed bean name is illegal from JSF's point of view. The resulting managed
bean name will be "". It can be used without problems for defining the
corresponding managed bean in your faces-config.xml. The problem is: it can never be used
as a value binding expression.
+ The reason: JSFs default !VariableResolver interprets the first '.' in a value binding expression
as separator between the scoped object (e.g. a managed bean) and the referenced property or
method. So in this small example the !VariableResolver would look for a managed bean called
"tiles" which is not defined - booom!
+ == Custom Implementation ==
+ To modify the mapping between view ids and managed bean names you can replace the !DefaultViewControllerMapper
with an own implementation. As I stated in my message  [
here], you have to provide the following context parameter entry in your web.xml:{{{
+ <context-param>
+   <param-name>org.apache.shale.view.VIEW_CONTROLLER_MAPPER</param-name>
+   <param-value>foo.MyVerySpecialViewControllerMapper</param-value>
+ </context-param>}}}

View raw message