You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2013/03/31 16:33:11 UTC
svn commit: r1462973 -
/incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext
Author: gpetracek
Date: Sun Mar 31 14:33:10 2013
New Revision: 1462973
URL: http://svn.apache.org/r1462973
Log:
updated content
Modified:
incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext
Modified: incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext
URL: http://svn.apache.org/viewvc/incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext?rev=1462973&r1=1462972&r2=1462973&view=diff
==============================================================================
--- incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext (original)
+++ incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext Sun Mar 31 14:33:10 2013
@@ -344,6 +344,33 @@ That means e.g.
leads to the invocation of the pre-render-view logic before /pages/page1.xhtml gets rendered (and
it won't be called for other pages).
+### Using ViewNavigationHandler
+With JSF you typically navigate with the action-method bound to a command-component.
+However, also JSF supports manual navigation via `javax.faces.application.NavigationHandler`.
+With `ViewNavigationHandler` DeltaSpike provides an equivalent optimized for type-safe view-configs which is easier to use (and can be used also for other (supported) view technology).
+
+A simple example is:
+
+ :::java
+ interface Pages {
+ class Index implements ViewConfig { }
+ }
+
+ @Model
+ public class AnyController
+ {
+ @Inject
+ private ViewNavigationHandler viewNavigationHandler;
+
+ public void anyMethod()
+ {
+ //navigates to /pages/index.xhtml
+ this.viewNavigationHandler.navigateTo(Pages.Index.class);
+ }
+ }
+
+Also in this case (optional) meta-data will be used for the navigation process, since `ViewNavigationHandler` just delegates to the active navigation-handler (of JSF).
+
### Configuring a Default Error-View
It's possible to mark one view-config class as default error-view. That means in case of errors it will be used as navigation target automatically.
Furthermore, it's also possible to use it in your code instead of hardcoding your error-view across the whole application.