deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r922514 [8/11] - in /websites/staging/deltaspike/trunk/content: ./ documentation/ retired/
Date Wed, 17 Sep 2014 12:22:53 GMT
Added: websites/staging/deltaspike/trunk/content/retired/jsf.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/retired/jsf.html (added)
+++ websites/staging/deltaspike/trunk/content/retired/jsf.html Wed Sep 17 12:22:52 2014
@@ -0,0 +1,1563 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="deltaspike-generate-pages">
+    <meta name="author" content="chm">
+
+    <title>Apache DeltaSpike - JSF</title>
+
+    
+
+    
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
+
+    <!-- Styles -->
+    
+    <link href="./../resources/css/bootstrap.css" rel="stylesheet">    
+    <!--<link href="./../resources/css/prettify.css" rel="stylesheet" /> -->
+    <link href="./../resources/css/codehilite.css" rel="stylesheet" />
+    <link href="./../resources/css/bootstrap-responsive.css" rel="stylesheet">
+    <style type="text/css">
+        body {
+            padding-top: 60px;
+            padding-bottom: 40px;
+        }
+    </style>
+	<script type="text/javascript">
+
+	  var _gaq = _gaq || [];
+	  _gaq.push(['_setAccount', 'UA-36103647-1']);
+	  _gaq.push(['_trackPageview']);
+	
+	  (function() {
+		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+	  })();
+	
+	</script>
+</head>
+
+<body>
+    <div class="navbar navbar-fixed-top">
+        <div class="navbar-inner">
+            <div class="container">
+                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                </a>
+                <a class="brand logocolor" href="/index.html">Apache DeltaSpike</a>
+                <div class="nav-collapse">
+                    <ul class="nav">
+                        <li class="active"><a href="./../index.html">Home</a></li>
+                        <li><a href="./../documentation.html">Documentation</a></li>
+                        <li><a href="./../source.html">Source</a></li>
+                        <li><a href="./../download.html">Download</a></li>
+                        <li><a href="./../community.html">Community</a></li>
+                        <!-- <li><a href="./../support.html">Support</a></li>  -->
+                        <li><a href="./../news.html">News</a></li>
+                        <li><a href="./../migration-guide.html">Migration</a></li>
+                    </ul>
+                </div><!--/.nav-collapse -->
+                <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+                    <input value="deltaspike.apache.org" name="sitesearch" type="hidden"/>
+                    <input class="search-query" name="q" id="query" type="text" />
+                </form>
+            </div>
+        </div>
+    </div>
+
+    <div class="container">
+      <div class="row">
+          <div class="span12">
+              <div class="page-title">
+                <h1>JSF</h1>
+              </div>
+              <div class="toc">
+<ul>
+<li><a href="#multi-window-handling">Multi-Window Handling</a><ul>
+<li><a href="#intro">Intro</a><ul>
+<li><a href="#historic-considerations">Historic Considerations</a></li>
+<li><a href="#how-jsf-2-changed-the-world">How JSF-2 changed the world</a></li>
+<li><a href="#standard-windowid-handling">Standard windowId Handling</a></li>
+</ul>
+</li>
+<li><a href="#available-modes">Available modes</a><ul>
+<li><a href="#clientwindow">CLIENTWINDOW</a><ul>
+<li><a href="#advantage">Advantage</a></li>
+<li><a href="#disadvantage">Disadvantage</a></li>
+<li><a href="#change-windowhandlerhtml">Change windowhandler.html</a></li>
+</ul>
+</li>
+<li><a href="#lazy">LAZY</a><ul>
+<li><a href="#advantage_1">Advantage</a></li>
+<li><a href="#disadvantage_1">Disadvantage</a></li>
+<li><a href="#workflow-example">Workflow example</a><ul>
+<li><a href="#first-get-request-with-windowid">First GET request with windowId</a></li>
+<li><a href="#first-get-request-without-windowid">First GET request without windowId</a></li>
+<li><a href="#further-get-request-with-windowid">Further GET request with windowId</a></li>
+<li><a href="#further-get-request-without-windowid">Further GET request without windowId</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#none">NONE</a></li>
+<li><a href="#delegated">DELEGATED</a></li>
+<li><a href="#custom">CUSTOM</a></li>
+</ul>
+</li>
+<li><a href="#configuration">Configuration</a><ul>
+<li><a href="#dswindowid">ds:windowId</a></li>
+<li><a href="#dsdisableclientwindow">ds:disableClientWindow</a></li>
+<li><a href="#switch-mode">Switch Mode</a></li>
+<li><a href="#provide-a-custom-clientwindow">Provide a custom ClientWindow</a></li>
+</ul>
+</li>
+<li><a href="#based-scopes">Based Scopes</a></li>
+</ul>
+</li>
+<li><a href="#scopes">Scopes</a><ul>
+<li><a href="#windowscoped">@WindowScoped</a></li>
+<li><a href="#viewaccessscoped-since-06">@ViewAccessScoped (since 0.6)</a></li>
+<li><a href="#groupedconversationscoped-since-06">@GroupedConversationScoped (since 0.6)</a></li>
+<li><a href="#viewscoped">@ViewScoped</a></li>
+<li><a href="#jsf-20-scopes">JSF 2.0 Scopes</a></li>
+</ul>
+</li>
+<li><a href="#integration-with-deltaspike-type-safe-messages">Integration with DeltaSpike type-safe messages</a></li>
+<li><a href="#type-safe-view-configs">Type-safe View-Configs</a><ul>
+<li><a href="#intro_1">Intro</a></li>
+<li><a href="#motivation">Motivation</a></li>
+<li><a href="#bean-discovery-mode-annotated">Bean-discovery-mode annotated</a></li>
+<li><a href="#basic-api-usages">Basic API usages</a><ul>
+<li><a href="#file-view-and-folder-folder-paths">File (@View) and Folder (@Folder) paths</a><ul>
+<li><a href="#foldername">@Folder#name</a></li>
+<li><a href="#view">@View</a></li>
+</ul>
+</li>
+<li><a href="#navigation-parameters">Navigation Parameters</a><ul>
+<li><a href="#static-configuration-via-navigationparameter">Static Configuration via @NavigationParameter</a></li>
+<li><a href="#dynamic-configuration-via-navigationparametercontext">Dynamic Configuration via NavigationParameterContext</a></li>
+</ul>
+</li>
+<li><a href="#security-integration-via-secured">Security Integration via @Secured</a></li>
+<li><a href="#view-controller-callbacks-via-viewcontrollerref">View-Controller Callbacks via @ViewControllerRef</a></li>
+<li><a href="#referencing-views-via-viewref">Referencing Views via @ViewRef</a></li>
+<li><a href="#using-the-optional-viewnavigationhandler">Using the (optional) ViewNavigationHandler</a></li>
+<li><a href="#configuring-a-default-error-view">Configuring a Default Error-View</a></li>
+<li><a href="#using-matches">Using @Matches</a></li>
+<li><a href="#using-viewconfigresolver">Using ViewConfigResolver</a></li>
+</ul>
+</li>
+<li><a href="#advanced-api-usages">Advanced API usages</a><ul>
+<li><a href="#creating-custom-meta-data-via-viewmetadata">Creating Custom Meta-Data via @ViewMetaData</a></li>
+<li><a href="#creating-custom-meta-data-via-stereotype">Creating Custom Meta-Data via @Stereotype</a></li>
+<li><a href="#creating-custom-callbacks-via-viewmetadata">Creating Custom Callbacks via @ViewMetaData</a></li>
+<li><a href="#creating-custom-inline-meta-data-via-inlineviewmetadata">Creating Custom inline Meta-Data via @InlineViewMetaData</a></li>
+</ul>
+</li>
+<li><a href="#path-validation">Path-Validation</a></li>
+<li><a href="#view-config-spi">View-Config SPI</a><ul>
+<li><a href="#configdescriptorvalidator">ConfigDescriptorValidator</a></li>
+<li><a href="#confignodeconverter">ConfigNodeConverter</a></li>
+<li><a href="#configpreprocessor">ConfigPreProcessor</a></li>
+<li><a href="#inlinemetadatatransformer">InlineMetaDataTransformer</a></li>
+<li><a href="#targetviewconfigprovider">TargetViewConfigProvider</a></li>
+<li><a href="#viewconfiginheritancestrategy">ViewConfigInheritanceStrategy</a></li>
+<li><a href="#viewconfignode">ViewConfigNode</a></li>
+<li><a href="#viewconfigroot">@ViewConfigRoot</a></li>
+</ul>
+</li>
+<li><a href="#activation-of-custom-naming-conventions">Activation of custom naming conventions</a></li>
+</ul>
+</li>
+<li><a href="#grouped-conversations">(Grouped-)Conversations</a><ul>
+<li><a href="#terminating-conversations">Terminating Conversations</a></li>
+<li><a href="#sub-conversation-groups">Sub-Conversation-Groups</a></li>
+</ul>
+</li>
+<li><a href="#injection-in-jsf-artifacts-todo">Injection in JSF Artifacts (TODO)</a><ul>
+<li><a href="#converter-validator">Converter &amp; Validator</a></li>
+<li><a href="#phaselistener">PhaseListener</a></li>
+</ul>
+</li>
+<li><a href="#event-broadcasting">Event broadcasting</a><ul>
+<li><a href="#beforejsfrequest-afterjsfrequest-todo">BeforeJsfRequest / AfterJsfRequest (TODO)</a></li>
+<li><a href="#beforephase-afterphase-todo">BeforePhase / AfterPhase (TODO)</a></li>
+<li><a href="#jsf-systemevents">JSF SystemEvents</a></li>
+</ul>
+</li>
+<li><a href="#intergration-with-exception-control-since-06">Intergration with Exception Control (since 0.6)</a><ul>
+<li><a href="#examples">Examples</a><ul>
+<li><a href="#basic">Basic</a></li>
+<li><a href="#redirect">Redirect</a></li>
+</ul>
+</li>
+<li><a href="#using-a-custom-qualifier-for-jsf-exceptions">Using a custom qualifier for JSF Exceptions</a></li>
+</ul>
+</li>
+<li><a href="#double-submit-prevention">Double-Submit prevention</a></li>
+<li><a href="#support-of-ear-deployments">Support of EAR deployments</a></li>
+<li><a href="#hints">Hints</a></li>
+</ul>
+</div>
+<hr />
+<h1 id="multi-window-handling">Multi-Window Handling</h1>
+<h2 id="intro">Intro</h2>
+<h3 id="historic-considerations">Historic Considerations</h3>
+<p>Until the end of the 1990s web browsers are usually single threaded and only had one window. But in the last years browsers supporting multiple windows or even tab became the standard. Since those days lots of efforts went into uniquely identifying a single browser window on the server side. Sadly browser windows still lack of a native windowId, thus maintaining web application data in @SessionScoped backing beans is still used in most of the cases.</p>
+<h3 id="how-jsf-2-changed-the-world">How JSF-2 changed the world</h3>
+<p>The MyFaces Orchestra community did a good summary about the various ways to handle multiple window support in JSF Applications. Those findings are still valid and up to date, but the environmental conditions have changed slightly since then.
+<br />
+It is easy to pass a windowId around with a POST request, but it gets tricky with GET requests. Due to the new JSF-2 ability to use bookmarkable URLs and deep links, a typical JSF-2 application contains much more GET links than we used to see in JSF-1, thus we have far more href links to cope with.</p>
+<h3 id="standard-windowid-handling">Standard windowId Handling</h3>
+<p>With a classical approach we would not be able to simply add a windowId parameter to such links because if the user would open the link in a new browser window or tab, we would carry the windowId - and thus the window scope - over to the new browser tab/window. The classic solution was to omit the windowId for all GET links, but by doing this we would now loose the window scope far too often with JSF-2!
+<br />
+Marios summary also contains a method to prevent this problem by storing a value directly in the browser window via JavaScript. Usually this is rendered and executed in the same page as the user form. See the "Post-render window detection" paragraph for a more detailed description.
+The major downside of this solution is that we might already pollute 'foreign' beans (and destroy their information) while rendering the page, which means this is not feasible as general solution.</p>
+<h2 id="available-modes">Available modes</h2>
+<h3 id="clientwindow">CLIENTWINDOW</h3>
+<p>Each GET request results in an intermediate small html page which checks if the browser tab fits the requested windowId. <br/>
+When the windowId is valid, a unique token (called <code>dsRid</code>) will be generated for the current request and added to the URL. <br/>
+In addition a cookie with with the dsRid/windowId will be added. On the server side, the verified windowId will be extracted from the cookie.
+<br/>
+For POST request detection, the windowId will be added as hidden input to all forms.</p>
+<h5 id="advantage">Advantage</h5>
+<ul>
+<li>Covers all edge cases</li>
+</ul>
+<h5 id="disadvantage">Disadvantage</h5>
+<ul>
+<li>Having the windowhandler.html site rendered between requests sometimes leads to some 'flickering' if the destination page takes some time to load. The browser first renders our windowhandler and only after that the original page will get loaded. <br/>
+This effect may be minimized by branding the windowhandler.html page and providing an own one with a bgcolor which matches your application.<br/>
+For html-5 aware browsers we also got rid of this flickering by storing away a 'screenshot' of the first page in onclick() and immediately restore this 'screenshot' on the intermediate windowhandler.html page. Technically we do this by storing away the <body> and css information into the html5 localStorage and restore them on the intermediate page. We also introduced a WindowConfig which is able to parse a request and decide upon the UserAgent or any other information if a client will get an intermediate page or if he gets the result page directly.</li>
+</ul>
+<h4 id="change-windowhandlerhtml">Change windowhandler.html</h4>
+<p>To customize the look &amp; feel of the windowhandler.html, you can simply provide a own via:</p>
+<div class="codehilite"><pre><span class="nd">@Specializes</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyClientWindowConfig</span> <span class="kd">extends</span> <span class="n">DefaultClientWindowConfig</span>
+<span class="o">{</span>
+    <span class="nd">@Override</span>
+    <span class="kd">public</span> <span class="n">String</span> <span class="nf">getClientWindowHtml</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="s">&quot;&lt;html&gt;&lt;body&gt;Loading...&lt;/body&gt;&lt;/html&gt;&quot;</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p><br/></p>
+<h3 id="lazy">LAZY</h3>
+<p>Always appends the windowId to all, from JSF generated, URLs.<br/>
+On the first GET request without a windowId, it will generate a new windowId and redirect, with the windowId in the URL, to the same view again.<br/>
+The current windowId will be stored in the <code>window.name</code> variable on the client side. <br/>
+For all further requests, a lazy check will be performed to check if the windowId in the URL is matching with the <code>window.name</code>.
+If it's not matching, the view will be refreshed with the right windowId in the URL.</p>
+<h5 id="advantage_1">Advantage</h5>
+<ul>
+<li>No windowhandler.html / loading screen required</li>
+</ul>
+<h5 id="disadvantage_1">Disadvantage</h5>
+<ul>
+<li>It could happen that 2 tabs will share the same windowId for 1 request because the <code>LAZY</code> mode will check lazily, after rendering the view, if the windowId matches the <code>window.name</code>. Therefore it could happen that @ViewAccessScoped or other scopes will unintentionally be destroyed.</li>
+</ul>
+<h4 id="workflow-example">Workflow example</h4>
+<h5 id="first-get-request-with-windowid">First GET request with windowId</h5>
+<ul>
+<li>Renders the view</li>
+<li>Stores the windowId as <code>window.name</code> on the client side</li>
+</ul>
+<h5 id="first-get-request-without-windowid">First GET request without windowId</h5>
+<ul>
+<li>Redirect to the same view with a new windowId in the URL</li>
+<li>Renders the view</li>
+<li>Stores the windowId as <code>window.name</code> on the client side</li>
+</ul>
+<h5 id="further-get-request-with-windowid">Further GET request with windowId</h5>
+<ul>
+<li>Renders the view</li>
+<li>Checks if the requested windowId matches the <code>window.name</code></li>
+<li>If it does not match, reload the URL with the right windowId taken from <code>window.name</code></li>
+</ul>
+<h5 id="further-get-request-without-windowid">Further GET request without windowId</h5>
+<ul>
+<li>Redirect to the same view with a new windowId in the URL</li>
+<li>Renders the view</li>
+<li>If it does not match, reload the URL with the right windowId taken from <code>window.name</code></li>
+</ul>
+<h3 id="none">NONE</h3>
+<p>Any window or browser tab detection will be disabled for the current request.<br/>
+Scopes like @WindowScoped, @GroupedConversationScoped or @ViewAccessScoped will not work.
+This is also the default mode if the current request doesn't support Javascript or if the user agent is a bot/crawler.</p>
+<h3 id="delegated">DELEGATED</h3>
+<p>Delegates the complete window handling to the new JSF 2.2 ClientWindow (if not disabled).</p>
+<h3 id="custom">CUSTOM</h3>
+<p>Enables to use an complete own <code>org.apache.deltaspike.jsf.spi.scope.window.ClientWindow</code> implementation.</p>
+<h2 id="configuration">Configuration</h2>
+<h3 id="dswindowid">ds:windowId</h3>
+<p>The component <code>ds:windowId</code> (<code>xmlns:ds="http://deltaspike.apache.org/jsf"</code>) is required to enable the full control of the DeltaSpike window handling.<br/>
+It will import and render the required script parts for both <code>LAZY</code> and <code>CLIENTWINDOW</code> mode.<br/>
+The best way, to apply it for all views, is to add this component to all of your templates.</p>
+<h3 id="dsdisableclientwindow">ds:disableClientWindow</h3>
+<p>Similiar to JSF 2.2' <code>disableClientWindow</code> attribute, <code>ds:disableClientWindow</code> provides the ability to disable the rendering of the windowId to all links of all child components:</p>
+<div class="codehilite"><pre><span class="nt">&lt;ds:disableClientWindow&gt;</span>
+    <span class="nt">&lt;h:link</span> <span class="na">value=</span><span class="s">&quot;Link without windowId&quot;</span> <span class="na">outcome=</span><span class="s">&quot;target.xhtml&quot;</span> <span class="nt">/&gt;</span>
+<span class="nt">&lt;/ds:disableClientWindow&gt;</span>
+<span class="nt">&lt;h:link</span> <span class="na">value=</span><span class="s">&quot;Link with windowId&quot;</span> <span class="na">outcome=</span><span class="s">&quot;target.xhtml&quot;</span><span class="nt">/&gt;</span>
+</pre></div>
+
+
+<h3 id="switch-mode">Switch Mode</h3>
+<p>To switch the mode, just provide a <code>org.apache.deltaspike.jsf.api.config.JsfModuleConfig</code> and overwrite <code>#getDefaultWindowMode</code>:</p>
+<div class="codehilite"><pre><span class="nd">@Specializes</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyJsfModuleConfig</span> <span class="kd">extends</span> <span class="n">JsfModuleConfig</span>
+<span class="o">{</span>
+    <span class="nd">@Override</span>
+    <span class="kd">public</span> <span class="n">ClientWindowConfig</span><span class="o">.</span><span class="na">ClientWindowRenderMode</span> <span class="nf">getDefaultWindowMode</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="c1">//...</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h3 id="provide-a-custom-clientwindow">Provide a custom ClientWindow</h3>
+<p>If you would like to provide an custom <code>org.apache.deltaspike.jsf.spi.scope.window.ClientWindow</code> implementation, you can just do it e.g. via CDI alternatives:</p>
+<div class="codehilite"><pre><span class="nd">@ApplicationScoped</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyClientWindow</span> <span class="kd">implements</span> <span class="n">ClientWindow</span>
+<span class="o">{</span>
+    <span class="c1">//...</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Don't forget to set the <code>ClientWindowRenderMode</code> to 'CUSTOM' via the <code>JsfModuleConfig</code>:</p>
+<div class="codehilite"><pre><span class="nd">@Specializes</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyJsfModuleConfig</span> <span class="kd">extends</span> <span class="n">JsfModuleConfig</span>
+<span class="o">{</span>
+    <span class="nd">@Override</span>
+    <span class="kd">public</span> <span class="n">ClientWindowConfig</span><span class="o">.</span><span class="na">ClientWindowRenderMode</span> <span class="nf">getDefaultWindowMode</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">ClientWindowConfig</span><span class="o">.</span><span class="na">ClientWindowRenderMode</span><span class="o">.</span><span class="na">CUSTOM</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h2 id="based-scopes">Based Scopes</h2>
+<ul>
+<li>@WindowScoped</li>
+<li>@ViewAccessScoped</li>
+<li>@GroupedConversationScoped</li>
+</ul>
+<h1 id="scopes">Scopes</h1>
+<h2 id="windowscoped">@WindowScoped</h2>
+<p>The window-scope is like a session per window. That means that the data is bound to a window/tab and it not shared between windows (like the session scope does). Usually you need the window-scope instead of the session-scope. There aren't a lot of use-cases which need shared data between windows.</p>
+<div class="codehilite"><pre><span class="nd">@WindowScoped</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">PreferencesBean</span> <span class="kd">implements</span> <span class="n">Serializable</span>
+<span class="o">{</span>
+    <span class="c1">//...</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h2 id="viewaccessscoped-since-06">@ViewAccessScoped (since 0.6)</h2>
+<p>In case of conversations you have to un-scope beans manually (or they will be terminated automatically after a timeout). However, sometimes you need beans with a lifetime which is as long as needed and as short as possible - which are terminated automatically (as soon as possible). In such an use-case you can use this scope. The simple rule is, as long as the bean is referenced by a page - the bean will be available for the next page (if it's used again the bean will be forwarded again). It is important that it's based on the view-id of a page (it isn't based on the request) so e.g. Ajax requests <b>don't</b> trigger a cleanup if the request doesn't access all view-access scoped beans of the page. That's also the reason for the name @<em>View</em>AccessScoped.</p>
+<div class="codehilite"><pre><span class="nd">@ViewAccessScoped</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">WizardBean</span> <span class="kd">implements</span> <span class="n">Serializable</span>
+<span class="o">{</span>
+    <span class="c1">//...</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Hint: <br/>
+@ViewAccessScoped beans are best used in conjunction with the <code>CLIENTWINDOW</code> window handling, which ensures a clean browser-tab separation without touching the old windowId. Otherwise a 'open in new tab' on a page with a @ViewAccessScoped bean might cause the termination (and re-initialization) of that bean.</p>
+<h2 id="groupedconversationscoped-since-06">@GroupedConversationScoped (since 0.6)</h2>
+<p>See <a href="#grouped-conversations">(Grouped-)Conversations</a></p>
+<h2 id="viewscoped">@ViewScoped</h2>
+<p>DeltaSpike provides an CDI context for the JSF 2.0/2.1 @javax.faces.bean.ViewScoped. You can simply annotate your bean with @javax.faces.bean.ViewScoped and @Named.</p>
+<h2 id="jsf-20-scopes">JSF 2.0 Scopes</h2>
+<p>JSF 2.0 introduced new annotations as well as a new scope - the View Scope. CODI allows to use all the CDI mechanisms in beans annotated with:</p>
+<ul>
+<li>javax.faces.bean.ApplicationScoped</li>
+<li>javax.faces.bean.SessionScoped</li>
+<li>javax.faces.bean.RequestScoped</li>
+<li>javax.faces.bean.ViewScoped</li>
+</ul>
+<p>Furthermore, the managed-bean annotation (javax.faces.bean.ManagedBean) is mapped to @Named from CDI.</p>
+<p>All these annotations are mapped automatically. So you won't face issues, if you import a JSF 2 annotation instead of the corresponding CDI annotation.</p>
+<h1 id="integration-with-deltaspike-type-safe-messages">Integration with DeltaSpike type-safe messages</h1>
+<p>You can use <a href="core.html#messages-i18n">DeltaSpike type-safe messages</a> with JSF to provide i18n messages and test to an JSF appplicaton.</p>
+<p>JSF module is also capable to use messages provided through <message-bundle> in faces-config.xml file. The <message-bundle> element allows you to override JSF default messages (Section 2.5.2.4 of the JSF specification contains the list of all JSF default messages that could be override.).</p>
+<p>DeltaSpike can also reuse the same file to provide type-safe messages so you don't have to use the naming convention nor <code>@MessageContextConfig</code>. If there is a config for supported locales it will be checked as well and fallback to the configured default locale.</p>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="nd">@MessageBundle</span>
+<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">SimpleMessage</span>
+<span class="o">{</span>
+    <span class="nd">@MessageTemplate</span><span class="o">(</span><span class="s">&quot;{welcome_to_deltaspike}&quot;</span><span class="o">)</span>
+    <span class="n">String</span> <span class="nf">welcomeToDeltaSpike</span><span class="o">();</span>
+<span class="o">}</span>
+
+<span class="nd">@Model</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">PageBean</span>
+<span class="o">{</span>
+
+    <span class="nd">@Inject</span>
+    <span class="kd">private</span> <span class="n">SimpleMessage</span> <span class="n">messages</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">actionMethod</span><span class="o">(){</span>
+        <span class="n">FacesContext</span><span class="o">.</span><span class="na">getCurrentInstance</span><span class="o">().</span><span class="na">addMessage</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span><span class="k">new</span> <span class="n">FacesMessage</span><span class="o">(</span><span class="n">messages</span><span class="o">.</span><span class="na">welcomeToDeltaSpike</span><span class="o">()));</span>
+    <span class="o">}</span>
+
+<span class="o">}</span>
+
+
+<span class="n">org</span><span class="o">.</span><span class="na">apache</span><span class="o">.</span><span class="na">deltaspike</span><span class="o">.</span><span class="na">example</span><span class="o">.</span><span class="na">message</span><span class="o">.</span><span class="na">SimpleMessage</span>
+
+<span class="o">-&gt;</span>
+
+<span class="n">org</span><span class="o">/</span><span class="n">apache</span><span class="o">/</span><span class="n">deltaspike</span><span class="o">/</span><span class="n">example</span><span class="o">/</span><span class="n">message</span><span class="o">/</span><span class="n">SimpleMessage</span><span class="o">.</span><span class="na">properties</span>
+<span class="n">org</span><span class="o">/</span><span class="n">apache</span><span class="o">/</span><span class="n">deltaspike</span><span class="o">/</span><span class="n">example</span><span class="o">/</span><span class="n">message</span><span class="o">/</span><span class="n">SimpleMessage</span><span class="o">.</span><span class="na">properties</span>
+<span class="n">org</span><span class="o">/</span><span class="n">apache</span><span class="o">/</span><span class="n">deltaspike</span><span class="o">/</span><span class="n">example</span><span class="o">/</span><span class="n">message</span><span class="o">/</span><span class="n">SimpleMessage_en</span><span class="o">.</span><span class="na">properties</span>
+<span class="n">org</span><span class="o">/</span><span class="n">apache</span><span class="o">/</span><span class="n">deltaspike</span><span class="o">/</span><span class="n">example</span><span class="o">/</span><span class="n">message</span><span class="o">/</span><span class="n">SimpleMessage_de</span><span class="o">.</span><span class="na">properties</span>
+
+<span class="o">...</span>
+
+<span class="c1">//content (as usual in message bundle files):</span>
+<span class="n">welcome_to_deltaspike</span><span class="o">=</span><span class="n">Welcome</span> <span class="n">to</span> <span class="n">DeltaSpike</span>
+<span class="c1">//Overrided JSF messages</span>
+<span class="n">javax</span><span class="o">.</span><span class="na">faces</span><span class="o">.</span><span class="na">component</span><span class="o">.</span><span class="na">UIInput</span><span class="o">.</span><span class="na">REQUIRED</span> <span class="o">=</span> <span class="o">{</span><span class="mi">0</span><span class="o">}:</span> <span class="n">Please</span> <span class="n">enter</span> <span class="n">a</span> <span class="n">value</span>
+</pre></div>
+
+
+<p>On faces-config.xml file:</p>
+<div class="codehilite"><pre><span class="nt">&lt;faces-config&gt;</span>
+    <span class="nt">&lt;application&gt;</span>
+        <span class="nt">&lt;message-bundle&gt;</span>org.apache.deltaspike.example.message.SimpleMessage<span class="nt">&lt;/message-bundle&gt;</span>
+    <span class="nt">&lt;/application&gt;</span>
+<span class="nt">&lt;/faces-config&gt;</span>
+</pre></div>
+
+
+<h1 id="type-safe-view-configs">Type-safe View-Configs</h1>
+<h2 id="intro_1">Intro</h2>
+<p>Type-safe view-configs are static configs which can be used in combination with every view-technology which is based on Java.
+Currently DeltaSpike itself provides an integration for JSF, however, the basic concepts are independent of it.
+(Since DeltaSpike provides the default integration only for JSF, the whole documentation for view-configs is located here.)</p>
+<p>Thanks to features like multiple (meta-data-)inheritance via interfaces, it provides a powerful approach to bind meta-data to one or multiple views.
+In case of the JSF integration it's possible to provide e.g. type-safe meta-data for security, navigation, callbacks for view-controllers.
+Beyond configuring view (/pages) via this concept, it's also possible to use the (view-)config classes for type-safe navigation.
+Since it's std. Java, you can benefit from any Java-IDE and you don't need special IDE-Addons to use it efficiently.</p>
+<p>Even the concepts provided by modules (of DeltaSpike itself) are based on the basic API provided by the Core. So it's possible to introduce custom concepts the same way DeltaSpike itself does.</p>
+<h2 id="motivation">Motivation</h2>
+<p>Instead of learning the concepts and rules of view-configs provided by DeltaSpike, it might be easier for simple demos to just type some simple(r) strings.
+So why should you use something which is slightly more work <strong>initially</strong>?</p>
+<p><strong>The short answer is:</strong></p>
+<p>It gives a good return in case of real applications (esp. beyond simple demos).</p>
+<p><strong>The long answer is:</strong></p>
+<p>You can benefit from it from the first second:</p>
+<ul>
+<li>It's type-safe -&gt;<ul>
+<li>the Java compiler ensures that you don't have typos at the final usages (and the rest can be checked during bootstrapping of the application)</li>
+<li>you can benefit from the auto.complete features of any modern Java IDE.</li>
+</ul>
+</li>
+<li>If you change the name of a file/folder, you need only one (easy) code-change in a single place and your (std. Java-) IDE will do the rest for you (= update all usages) without a special plug-in</li>
+<li>It's possible to restrict the navigation target -&gt; you can ensure that the navigation target is still the intended one (e.g. after a refactoring)</li>
+<li>You can configure meta-data in a central place (which can get inherited via <strong>multiple</strong> inheritance based on Java interfaces)</li>
+<li>Easier for developers to find usages</li>
+<li>Allows easy(er) refactorings and maintenance</li>
+<li>You can use your IDE more efficiently esp. in large projects
+   (there are some users who initially switched to it, because their tools for displaying the config they had before open large config files very slowly...)</li>
+<li>Modern Java IDEs show inheritance of interfaces and classes in a nice way. Since the view-config is based on std. classes and interfaces, you can benefit from it easily.</li>
+</ul>
+<p>Advantages which are planned for later (= currently not supported):</p>
+<ul>
+<li>It's possible to check if the configured folders and files really exist during/after the bootstrapping phase of the application (currently it isn't implemented, but it's possible to do it).</li>
+<li>It's also easy(er) for tools (IDE plugins,...) to validate it</li>
+<li>It's possible to validate the config (if the corresponding path (view or folder) really exists (after v0.5 it's done out-of-the-box)</li>
+</ul>
+<p>If you are still not convinced, you just have to try it. You will see how your daily workflow benefits from it pretty soon.</p>
+<h2 id="bean-discovery-mode-annotated">Bean-discovery-mode annotated</h2>
+<p>CDI 1.1 introduced a concept called bean-discovery-mode. If you would like to use the mode <code>annotated</code>, please have a look at the hint at <a href="#viewconfigroot">@ViewConfigRoot</a></p>
+<h2 id="basic-api-usages">Basic API usages</h2>
+<p>While reading this section keep the following simple rules in mind:
+<ul>
+  <li>Meta-data gets inherited along the path of Java inheritance</li>
+  <li>File-/Folder- paths are build based on nesting classes and interfaces</li>
+</ul></p>
+<p>Usually users don't need to be aware of all descriptors, SPIs,... which are described by this documentation.</p>
+<p>There are a lot of possibilities to configure views and some of them are optional.
+The following examples show some of them in combination with features provided by the JSF- and Security-Module of DeltaSpike.</p>
+<p>The following example shows the minimal syntax for providing a config for a view (/page).</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyPage</span> <span class="kd">implements</span> <span class="n">ViewConfig</span>
+<span class="o">{</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Since it's a class (and not an interface) it's autom. recognized as config for a page (and not a folder) and the default settings get applied during bootstrapping.
+In case of JSF you can use it for navigation e.g. via action-methods.</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">ViewConfig</span><span class="o">&gt;</span> <span class="n">toNextPage</span><span class="o">()</span>
+<span class="o">{</span>
+    <span class="k">return</span> <span class="n">MyPage</span><span class="o">.</span><span class="na">class</span><span class="o">;</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>This leads to a forward to <code>/myPage.xhtml</code>. Information like base-path, file- (and folder-)name/s, file-extension, navigation mode, view-params,... can be customized with the corresponding (meta-data-)annotations.
+One of those annotations provided by the JSF module (which is optional) is <code>@View</code>. That means the following example leads to the same as the first one.</p>
+<div class="codehilite"><pre><span class="nd">@View</span> <span class="c1">//optional</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyPage</span> <span class="kd">implements</span> <span class="n">ViewConfig</span>
+<span class="o">{</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>But it's also possible to reflect the folder structure via nesting of interfaces and classes. An example for it is:</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span>
+<span class="o">{</span>
+    <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+
+    <span class="kd">interface</span> <span class="nc">AdminArea</span> <span class="kd">extends</span> <span class="n">ViewConfig</span>
+    <span class="o">{</span>
+        <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>In case of the JSF integration it leads to the following view-ids:<br/>
+/pages/index.xhtml<br/>
+/pages/adminArea/index.xhtml<br/></p>
+<p>Like the optional <code>@View</code> for pages represented by the classes, it's possible to use the optional <code>@Folder</code> annotation for directories represented by the (nested) interfaces.</p>
+<p>Furthermore, it's possible to inherit meta-data along with the normal inheritance.</p>
+<p>In the following example <code>Pages.Admin.Index</code>, <code>Pages.Admin.Home</code> and <code>Pages.Admin.Statistics.Home</code> inherit the meta-data from <code>Pages.Admin</code> because they implement the interface whereas <code>Pages.Admin.Statistics.Index</code> doesn't. However, <code>Pages.Admin.Home</code> overrides <code>View#navigation</code>. During the bootstrapping process the meta-data gets merged and at runtime you only see the final result (which is cached).</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span>
+<span class="o">{</span>
+    <span class="nd">@View</span><span class="o">(</span><span class="n">name</span> <span class="o">=</span> <span class="s">&quot;home&quot;</span><span class="o">,</span> <span class="n">extension</span> <span class="o">=</span> <span class="n">JSP</span><span class="o">)</span>
+    <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+
+    <span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">REDIRECT</span><span class="o">,</span> <span class="n">viewParams</span> <span class="o">=</span> <span class="n">INCLUDE</span><span class="o">)</span>
+    <span class="kd">interface</span> <span class="nc">Admin</span> <span class="kd">extends</span> <span class="n">ViewConfig</span>
+    <span class="o">{</span>
+        <span class="kd">interface</span> <span class="nc">Statistics</span>
+        <span class="o">{</span>
+            <span class="nd">@View</span> <span class="c1">//optional</span>
+            <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+
+            <span class="kd">class</span> <span class="nc">Home</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+        <span class="o">}</span>
+
+        <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">FORWARD</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Home</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>In this case <code>Pages.Admin.Statistics</code> is just an interface to reflect the folder structure. For sure it's also possible that it extends an existing view-config interface and other folders and/or pages inherit its meta-data (like <code>Pages.Admin</code>).</p>
+<p>Furthermore, inheritance can be used to ensure navigation to the correct area in the application. In the following example the return type of the action-method (and therefore the compiler of Java) ensures that the navigation target of this method is within the admin-area.</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">Pages</span><span class="o">.</span><span class="na">Admin</span><span class="o">&gt;</span> <span class="n">toNextPage</span><span class="o">()</span>
+<span class="o">{</span>
+    <span class="k">return</span> <span class="n">Pages</span><span class="o">.</span><span class="na">Admin</span><span class="o">.</span><span class="na">Index</span><span class="o">.</span><span class="na">class</span><span class="o">;</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h3 id="file-view-and-folder-folder-paths">File (@View) and Folder (@Folder) paths</h3>
+<p><code>@View</code> as well as <code>@Folder</code> are optional annotations.
+<code>@Folder</code> is only needed for using a different folder-name or for marking folder configs if they don't inherit from <code>org.apache.deltaspike.core.api.config.view.ViewConfig</code> <strong>nor</strong> have a view-config for a page nested into them (like Pages.Wizard1.Step1).
+If it isn't used explicitly, it gets added automatically (so you can query the meta-data at runtime even in cases you haven't placed the annotations explicitly).
+<code>@View</code> allows to customize a bit more and it also gets added automatically if it isn't used explicitly.
+Whereas <code>@Folder</code> gets added to all nested interfaces (above a view-config class - like Pages and Pages.Wizard1), <code>@View</code> only gets added to classes which in-/directly inherit from <code>org.apache.deltaspike.core.api.config.view.ViewConfig</code> (like Pages.Wizard1.Step1).</p>
+<p>That means at runtime the following two configs lead to the same.</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span>
+<span class="o">{</span>
+    <span class="kd">interface</span> <span class="nc">Wizard1</span>
+    <span class="o">{</span>
+        <span class="kd">class</span> <span class="nc">Step1</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+
+<span class="c1">//leads to the same as</span>
+
+<span class="nd">@Folder</span>
+<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span>
+<span class="o">{</span>
+    <span class="nd">@Folder</span>
+    <span class="kd">interface</span> <span class="nc">Wizard1</span>
+    <span class="o">{</span>
+        <span class="nd">@View</span>
+        <span class="kd">class</span> <span class="nc">Step1</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>The example above leads to the following paths:</p>
+<ul>
+<li>/pages/</li>
+<li>/pages/wizard1</li>
+<li>/pages/wizard1/step1.xhtml</li>
+</ul>
+<p>To customize it you can use <code>@Folder#name</code>, <code>@View#basePath</code>, <code>@View#name</code> and <code>@View#extension</code> (or you register custom <code>NameBuilder</code>s inline or globally).</p>
+<h4 id="foldername">@Folder#name</h4>
+<p>The rules are pretty simple. You will get what you write. There are only two additional features:</p>
+<ul>
+<li>You don't have to care about duplicated '/' (e.g. /folder1//folder2/step1.xhtml would get corrected auto. to /folder1/folder2/step1.xhtml)</li>
+<li>With "." at the beginning (e.g. "./") you can keep the path before.</li>
+</ul>
+<p>The following example</p>
+<div class="codehilite"><pre><span class="kd">interface</span> <span class="nc">Pages</span>
+<span class="o">{</span>
+    <span class="nd">@Folder</span><span class="o">(</span><span class="n">name</span> <span class="o">=</span> <span class="s">&quot;/w1/&quot;</span><span class="o">)</span>
+    <span class="kd">interface</span> <span class="nc">Wizard1</span>
+    <span class="o">{</span>
+        <span class="kd">class</span> <span class="nc">Step1</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+
+    <span class="nd">@Folder</span><span class="o">(</span><span class="n">name</span> <span class="o">=</span> <span class="s">&quot;./w2/&quot;</span><span class="o">)</span>
+    <span class="kd">interface</span> <span class="nc">Wizard2</span> <span class="kd">extends</span> <span class="n">ViewConfig</span>
+    <span class="o">{</span>
+        <span class="kd">class</span> <span class="nc">Step1</span> <span class="kd">implements</span> <span class="n">Wizard2</span> <span class="o">{</span> <span class="o">}</span>   <span class="c1">//ViewConfig is inherited indirectly</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>leads to the following paths:</p>
+<ul>
+<li>/pages/</li>
+<li>/w1/</li>
+<li>/w1/step1.xhtml</li>
+<li>/pages/w2/step1.xhtml</li>
+</ul>
+<h4 id="view">@View</h4>
+<p>The same naming rules apply to <code>@View#basePath</code>. However, it's only valid to be used at view-config nodes which represent pages (-&gt; classes and not interfaces).
+On interfaces always use <code>@Folder</code> (<code>@View#basePath</code> will get ignored there).</p>
+<div class="codehilite"><pre><span class="kd">interface</span> <span class="nc">Pages</span>
+<span class="o">{</span>
+    <span class="kd">interface</span> <span class="nc">Wizard1</span>
+    <span class="o">{</span>
+        <span class="nd">@View</span> <span class="c1">//optional</span>
+        <span class="kd">class</span> <span class="nc">Step1</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">basePath</span> <span class="o">=</span> <span class="s">&quot;/&quot;</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Step2</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">basePath</span> <span class="o">=</span> <span class="s">&quot;./&quot;</span><span class="o">)</span> <span class="c1">//or just &quot;.&quot;</span>
+        <span class="kd">class</span> <span class="nc">Step3</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">basePath</span> <span class="o">=</span> <span class="s">&quot;/w1/&quot;</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Step4</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">basePath</span> <span class="o">=</span> <span class="s">&quot;./w1/&quot;</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Step5</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>leads to the following paths:</p>
+<ul>
+<li>/pages</li>
+<li>/pages/wizard1/</li>
+<li>/pages/wizard1/step1.xhtml</li>
+<li>/step2.xhtml</li>
+<li>/pages/wizard1/step3.xhtml</li>
+<li>/w1/step4.xhtml</li>
+<li>/pages/wizard/w1/step5.xhtml</li>
+</ul>
+<p>and depending on additional meta-data you would like to inherit (e.g. <code>@View(navigation = REDIRECT)</code>), you can also use:</p>
+<div class="codehilite"><pre><span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">REDIRECT</span><span class="o">)</span>
+<span class="kd">interface</span> <span class="nc">Pages</span> <span class="kd">extends</span> <span class="n">ViewConfig</span>
+<span class="o">{</span>
+    <span class="kd">interface</span> <span class="nc">Wizard1</span> <span class="kd">extends</span> <span class="n">Pages</span>
+    <span class="o">{</span>
+        <span class="nd">@View</span>
+        <span class="kd">class</span> <span class="nc">Step1</span> <span class="kd">implements</span> <span class="n">Wizard1</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">basePath</span> <span class="o">=</span> <span class="s">&quot;/&quot;</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Step2</span> <span class="kd">implements</span> <span class="n">Wizard1</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">basePath</span> <span class="o">=</span> <span class="s">&quot;./&quot;</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Step3</span> <span class="kd">implements</span> <span class="n">Wizard1</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">basePath</span> <span class="o">=</span> <span class="s">&quot;/w1/&quot;</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Step4</span> <span class="kd">implements</span> <span class="n">Wizard1</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">basePath</span> <span class="o">=</span> <span class="s">&quot;./w1/&quot;</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Step5</span> <span class="kd">implements</span> <span class="n">Wizard1</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>It leads to the same paths, but in addition <code>@View#navigation</code> gets inherited along the inheritance path.</p>
+<h3 id="navigation-parameters">Navigation Parameters</h3>
+<p>Since the view-config is static, an approach to add parameters is needed. The following part shows different possibilities to add parameters which end up in the final URL after '?' (in case of the integration with JSF).
+It isn't needed to add all (types of) parameters that way. Some get added autom. based on special meta-data (e.g. <code>@View#navigation</code> and <code>@View#viewParams</code>). Instead of adding <code>"faces-redirect=true"</code> manually it's done for you as soon as you are using <code>@View(navigation = REDIRECT)</code>. The same goes for <code>"includeViewParams=true"</code> and <code>@View(viewParams = INCLUDE)</code>.</p>
+<h4 id="static-configuration-via-navigationparameter">Static Configuration via @NavigationParameter</h4>
+<p>In some cases it's needed to add an information in any case. So you can annotate the view-config class with <code>@NavigationParameter</code>. Supported values are static strings or EL-expressions.</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span> <span class="kd">extends</span> <span class="n">ViewConfig</span>
+<span class="o">{</span>
+    <span class="nd">@NavigationParameter</span><span class="o">(</span><span class="n">key</span> <span class="o">=</span> <span class="s">&quot;param1&quot;</span><span class="o">,</span> <span class="n">value</span> <span class="o">=</span> <span class="s">&quot;staticValue1&quot;</span><span class="o">)</span>
+    <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Pages</span> <span class="o">{</span> <span class="o">}</span>
+
+    <span class="nd">@NavigationParameter.List</span><span class="o">({</span>
+        <span class="nd">@NavigationParameter</span><span class="o">(</span><span class="n">key</span> <span class="o">=</span> <span class="s">&quot;param1&quot;</span><span class="o">,</span> <span class="n">value</span> <span class="o">=</span> <span class="s">&quot;staticValue1&quot;</span><span class="o">),</span>
+        <span class="nd">@NavigationParameter</span><span class="o">(</span><span class="n">key</span> <span class="o">=</span> <span class="s">&quot;param2&quot;</span><span class="o">,</span> <span class="n">value</span> <span class="o">=</span> <span class="s">&quot;#{myBean.property1}&quot;</span><span class="o">)</span>
+    <span class="o">})</span>
+    <span class="kd">class</span> <span class="nc">Overview</span> <span class="kd">implements</span> <span class="n">Pages</span> <span class="o">{</span> <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Instead of using parameters in any case, it's also possible to configure them statically for particular methods:</p>
+<div class="codehilite"><pre><span class="nd">@Model</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">PageBean</span>
+<span class="o">{</span>
+    <span class="nd">@NavigationParameter</span><span class="o">(</span><span class="n">key</span> <span class="o">=</span> <span class="s">&quot;param2&quot;</span><span class="o">,</span> <span class="n">value</span> <span class="o">=</span> <span class="s">&quot;#{myBean.property1}&quot;</span><span class="o">)</span>
+    <span class="kd">public</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">ViewConfig</span><span class="o">&gt;</span> <span class="n">actionMethod1</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">SimplePageConfig</span><span class="o">.</span><span class="na">class</span><span class="o">;</span>
+    <span class="o">}</span>
+
+    <span class="nd">@NavigationParameter.List</span><span class="o">({</span>
+        <span class="nd">@NavigationParameter</span><span class="o">(</span><span class="n">key</span> <span class="o">=</span> <span class="s">&quot;param1&quot;</span><span class="o">,</span> <span class="n">value</span> <span class="o">=</span> <span class="s">&quot;staticValue1&quot;</span><span class="o">),</span>
+        <span class="nd">@NavigationParameter</span><span class="o">(</span><span class="n">key</span> <span class="o">=</span> <span class="s">&quot;param2&quot;</span><span class="o">,</span> <span class="n">value</span> <span class="o">=</span> <span class="s">&quot;staticValue2&quot;</span><span class="o">)</span>
+    <span class="o">})</span>
+    <span class="kd">public</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">ViewConfig</span><span class="o">&gt;</span> <span class="n">actionMethod2</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">SimplePageConfig</span><span class="o">.</span><span class="na">class</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h4 id="dynamic-configuration-via-navigationparametercontext">Dynamic Configuration via NavigationParameterContext</h4>
+<p>Instead of using parameters in a static fashion (as shown above), it's also possible to add them dynamically (e.g. in case of special conditions).</p>
+<div class="codehilite"><pre><span class="nd">@Named</span>
+<span class="nd">@SessionScoped</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">PageBean</span>
+<span class="o">{</span>
+    <span class="kd">private</span> <span class="kt">int</span> <span class="n">currentValue</span> <span class="o">=</span> <span class="o">-</span><span class="mi">10</span><span class="o">;</span>
+
+    <span class="nd">@Inject</span>
+    <span class="kd">private</span> <span class="n">NavigationParameterContext</span> <span class="n">navigationParameterContext</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">ViewConfig</span><span class="o">&gt;</span> <span class="n">actionMethod</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="n">currentValue</span><span class="o">++;</span>
+
+        <span class="k">if</span> <span class="o">(</span><span class="n">currentValue</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="o">)</span>
+        <span class="o">{</span>
+            <span class="k">this</span><span class="o">.</span><span class="na">navigationParameterContext</span><span class="o">.</span><span class="na">addPageParameter</span><span class="o">(</span><span class="s">&quot;cv&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="na">currentValue</span><span class="o">);</span>
+        <span class="o">}</span>
+        <span class="k">return</span> <span class="n">SimplePageConfig</span><span class="o">.</span><span class="na">class</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h3 id="security-integration-via-secured">Security Integration via @Secured</h3>
+<p>This annotation is a custom view-meta-data provided by the Security-module which allows to integrate 3rd party frameworks (or custom approaches) to secure pages as well as whole folders.
+You can annotate specific parts or a marker-interface. <code>CustomAccessDecisionVoter</code> used in the following example can be any implementation of <code>org.apache.deltaspike.security.api.authorization.AccessDecisionVoter</code> and needs to be a std. CDI bean which means you can use dependecy-injection to trigger any kind of security check.
+All parts which inherit from <code>SecuredPages</code> (<code>Pages.Admin</code>, <code>Pages.Admin.Index</code> and <code>Pages.Admin.Home</code>) are protected by <code>CustomAccessDecisionVoter</code>.<br/></p>
+<p>(It's easy to check this hierarchy in a modern Java-IDE. Only for displaying the final meta-data for every node in the IDE a special plug-in would be needed.)</p>
+<div class="codehilite"><pre><span class="nd">@Secured</span><span class="o">(</span><span class="n">CustomAccessDecisionVoter</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">SecuredPages</span> <span class="o">{}</span>
+
+<span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">REDIRECT</span><span class="o">)</span>
+<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span> <span class="kd">extends</span> <span class="n">ViewConfig</span>
+<span class="o">{</span>
+    <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Pages</span> <span class="o">{</span> <span class="o">}</span>
+
+    <span class="kd">interface</span> <span class="nc">Admin</span> <span class="kd">extends</span> <span class="n">Pages</span><span class="o">,</span> <span class="n">SecuredPages</span>
+    <span class="o">{</span>
+        <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">FORWARD</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Home</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>For sure it's also possible to use it without a special interface. In this case you would need:</p>
+<div class="codehilite"><pre><span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">REDIRECT</span><span class="o">)</span>
+<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span> <span class="kd">extends</span> <span class="n">ViewConfig</span>
+<span class="o">{</span>
+    <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Pages</span> <span class="o">{</span> <span class="o">}</span>
+
+    <span class="nd">@Secured</span><span class="o">(</span><span class="n">CustomAccessDecisionVoter</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+    <span class="kd">interface</span> <span class="nc">Admin</span> <span class="kd">extends</span> <span class="n">Pages</span>
+    <span class="o">{</span>
+        <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">FORWARD</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Home</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>or:</p>
+<div class="codehilite"><pre><span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">REDIRECT</span><span class="o">)</span>
+<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span> <span class="kd">extends</span> <span class="n">ViewConfig</span>
+<span class="o">{</span>
+    <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Pages</span> <span class="o">{</span> <span class="o">}</span>
+
+    <span class="kd">interface</span> <span class="nc">Admin</span> <span class="kd">extends</span> <span class="n">Pages</span>
+    <span class="o">{</span>
+        <span class="nd">@Secured</span><span class="o">(</span><span class="n">CustomAccessDecisionVoter</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+
+        <span class="nd">@Secured</span><span class="o">(</span><span class="n">CustomAccessDecisionVoter</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+        <span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">FORWARD</span><span class="o">)</span>
+        <span class="kd">class</span> <span class="nc">Home</span> <span class="kd">implements</span> <span class="n">Admin</span> <span class="o">{</span> <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h3 id="view-controller-callbacks-via-viewcontrollerref">View-Controller Callbacks via @ViewControllerRef</h3>
+<p>This annotation is a custom view-meta-data provided by the JSF-module which allows to configure beans which should act as view-controllers. That means they can use view-controller callbacks like <code>@InitView</code>, <code>@PreViewAction</code>, <code>@PreRenderView</code> and <code>@PostRenderView</code>. The following example shows the usage of <code>@PreRenderView</code>.</p>
+<div class="codehilite"><pre><span class="c1">//@View //optional</span>
+<span class="nd">@ViewControllerRef</span><span class="o">(</span><span class="n">MyPageController</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyPage</span> <span class="kd">implements</span> <span class="n">ViewConfig</span>
+<span class="o">{</span>
+<span class="o">}</span>
+
+<span class="nd">@Model</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyPageController</span>
+<span class="o">{</span>
+    <span class="nd">@PreRenderView</span>
+    <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">load</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="c1">//...</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Since v0.7 it's possible to observe exceptions thrown by a @PreRenderView callback and use your configured Default-Error-View to display the exception.</p>
+<p>Example:</p>
+<div class="codehilite"><pre><span class="nd">@ExceptionHandler</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">ErrorViewAwareExceptionHandler</span> <span class="o">{</span>
+    <span class="nd">@Inject</span>
+    <span class="kd">private</span> <span class="n">ViewConfigResolver</span> <span class="n">viewConfigResolver</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">onIllegalStateException</span><span class="o">(</span><span class="nd">@Handles</span> <span class="n">ExceptionEvent</span><span class="o">&lt;</span><span class="n">IllegalStateException</span><span class="o">&gt;</span> <span class="n">e</span><span class="o">)</span>
+    <span class="o">{</span>
+        <span class="n">FacesContext</span> <span class="n">facesContext</span> <span class="o">=</span> <span class="n">FacesContext</span><span class="o">.</span><span class="na">getCurrentInstance</span><span class="o">();</span>
+
+        <span class="n">String</span> <span class="n">viewId</span> <span class="o">=</span> <span class="n">viewConfigResolver</span><span class="o">.</span><span class="na">getDefaultErrorViewConfigDescriptor</span><span class="o">().</span><span class="na">getViewId</span><span class="o">();</span>
+        <span class="n">UIViewRoot</span> <span class="n">viewRoot</span> <span class="o">=</span> <span class="n">facesContext</span><span class="o">.</span><span class="na">getApplication</span><span class="o">().</span><span class="na">getViewHandler</span><span class="o">().</span><span class="na">createView</span><span class="o">(</span><span class="n">facesContext</span><span class="o">,</span> <span class="n">viewId</span><span class="o">);</span>
+        <span class="n">facesContext</span><span class="o">.</span><span class="na">setViewRoot</span><span class="o">(</span><span class="n">viewRoot</span><span class="o">);</span>
+        <span class="c1">//... - e.g.: store the exception in a page-bean for the default-error-view</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h3 id="referencing-views-via-viewref">Referencing Views via @ViewRef</h3>
+<p>With <code>@ViewControllerRef#value</code> you can annotate a view-config class to bind (/reference) a controller to it. <code>@ViewRef#config</code> allows the same in the other direction.
+Use an existing view-config to reference one or many view/s.</p>
+<p>That means e.g.</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span> <span class="kd">extends</span> <span class="n">ViewConfig</span>
+<span class="o">{</span>
+    <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">Pages</span> <span class="o">{</span> <span class="o">}</span>
+<span class="o">}</span>
+
+<span class="nd">@ViewRef</span><span class="o">(</span><span class="n">Pages</span><span class="o">.</span><span class="na">Index</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+<span class="c1">//...</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">IndexController</span> <span class="kd">implements</span> <span class="n">Serializable</span>
+<span class="o">{</span>
+    <span class="nd">@PreRenderView</span>
+    <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">preRenderView</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="c1">//...</span>
+    <span class="o">}</span>
+
+    <span class="c1">//...</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>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).</p>
+<h3 id="using-the-optional-viewnavigationhandler">Using the (optional) ViewNavigationHandler</h3>
+<p>With JSF you typically navigate with the action-method bound to a command-component.
+However, also JSF supports manual navigation via <code>javax.faces.application.NavigationHandler</code>.
+With <code>ViewNavigationHandler</code> 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).</p>
+<p>A simple example is:</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span> <span class="o">{</span>
+    <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+<span class="o">}</span>
+
+<span class="nd">@Model</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">AnyController</span>
+<span class="o">{</span>
+    <span class="nd">@Inject</span>
+    <span class="kd">private</span> <span class="n">ViewNavigationHandler</span> <span class="n">viewNavigationHandler</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">anyMethod</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="c1">//navigates to /pages/index.xhtml</span>
+        <span class="k">this</span><span class="o">.</span><span class="na">viewNavigationHandler</span><span class="o">.</span><span class="na">navigateTo</span><span class="o">(</span><span class="n">Pages</span><span class="o">.</span><span class="na">Index</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Also in this case (optional) meta-data will be used for the navigation process, since <code>ViewNavigationHandler</code> just delegates to the active navigation-handler (of JSF).</p>
+<h3 id="configuring-a-default-error-view">Configuring a Default Error-View</h3>
+<p>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.</p>
+<p>In case of</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="kd">interface</span> <span class="nc">Pages</span> <span class="o">{</span>
+    <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">implements</span> <span class="n">ViewConfig</span> <span class="o">{</span> <span class="o">}</span>
+
+    <span class="kd">class</span> <span class="nc">CustomErrorPage</span> <span class="kd">extends</span> <span class="n">DefaultErrorView</span> <span class="o">{</span> <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>it's possible to navigate with <code>DefaultErrorView.class</code> instead of hardcoding it to <code>Pages.CustomErrorPage.class</code>.</p>
+<div class="codehilite"><pre><span class="nd">@Model</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">PageController</span>
+<span class="o">{</span>
+    <span class="kd">public</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">ViewConfig</span><span class="o">&gt;</span> <span class="n">actionWithoutError</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">Pages</span><span class="o">.</span><span class="na">Index</span><span class="o">.</span><span class="na">class</span><span class="o">;</span>
+    <span class="o">}</span>
+
+    <span class="kd">public</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">ViewConfig</span><span class="o">&gt;</span> <span class="n">actionWithError</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="c1">//navigates to the view which is configured as default error-view</span>
+        <span class="k">return</span> <span class="n">DefaultErrorView</span><span class="o">.</span><span class="na">class</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>If you are outside of an action-method you can also use it in combination with <code>ViewNavigationHandler</code>.</p>
+<div class="codehilite"><pre><span class="nd">@Model</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">AnyController</span>
+<span class="o">{</span>
+    <span class="nd">@Inject</span>
+    <span class="kd">private</span> <span class="n">ViewNavigationHandler</span> <span class="n">viewNavigationHandler</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">anyMethod</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="c1">//navigates to the view which is configured as default error-view</span>
+        <span class="k">this</span><span class="o">.</span><span class="na">viewNavigationHandler</span><span class="o">.</span><span class="na">navigateTo</span><span class="o">(</span><span class="n">DefaultErrorView</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>However, in case of JSF you have to ensure that you are at a valid point in the JSF request-lifecycle for a navigation, because invocation gets transformed to a std. (implicit) JSF navigation.</p>
+<h3 id="using-matches">Using @Matches</h3>
+<p>This annotation is currently not integrated.
+[TODO]</p>
+<h3 id="using-viewconfigresolver">Using ViewConfigResolver</h3>
+<p>If you would like to query view-meta-data yourself (for whatever reason), you can do that with <code>ViewConfigResolver</code>.</p>
+<div class="codehilite"><pre><span class="nd">@RequestScoped</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">ApiDemoBean</span>
+<span class="o">{</span>
+    <span class="nd">@Inject</span>
+    <span class="kd">private</span> <span class="n">ViewConfigResolver</span> <span class="n">viewConfigResolver</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="n">String</span> <span class="nf">getViewId</span><span class="o">(</span><span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">ViewConfig</span><span class="o">&gt;</span> <span class="n">viewConfigClass</span><span class="o">)</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">viewConfigResolver</span><span class="o">.</span><span class="na">getViewConfigDescriptor</span><span class="o">(</span><span class="n">viewConfigClass</span><span class="o">).</span><span class="na">getViewId</span><span class="o">();</span> <span class="c1">//or #getPath</span>
+    <span class="o">}</span>
+
+    <span class="kd">public</span> <span class="n">String</span> <span class="nf">getPath</span><span class="o">(</span><span class="n">Class</span> <span class="n">pathConfigClass</span><span class="o">)</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">viewConfigResolver</span><span class="o">.</span><span class="na">getConfigDescriptor</span><span class="o">(</span><span class="n">pathConfigClass</span><span class="o">).</span><span class="na">getPath</span><span class="o">();</span>
+    <span class="o">}</span>
+
+    <span class="kd">public</span> <span class="n">List</span><span class="o">&lt;</span><span class="n">ConfigDescriptor</span><span class="o">&lt;?&gt;&gt;</span> <span class="n">getAllFolderDescriptors</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">viewConfigResolver</span><span class="o">.</span><span class="na">getConfigDescriptors</span><span class="o">();</span>
+    <span class="o">}</span>
+
+    <span class="kd">public</span> <span class="n">List</span><span class="o">&lt;</span><span class="n">ViewConfigDescriptor</span><span class="o">&gt;</span> <span class="n">getAllPageDescriptors</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">viewConfigResolver</span><span class="o">.</span><span class="na">getViewConfigDescriptors</span><span class="o">();</span>
+    <span class="o">}</span>
+
+    <span class="kd">public</span> <span class="n">ViewConfigDescriptor</span> <span class="nf">getCurrentViewConfig</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">viewConfigResolver</span><span class="o">.</span><span class="na">getViewConfigDescriptor</span><span class="o">(</span><span class="n">FacesContext</span><span class="o">.</span><span class="na">getCurrentInstance</span><span class="o">().</span><span class="na">getViewRoot</span><span class="o">().</span><span class="na">getViewId</span><span class="o">());</span>
+    <span class="o">}</span>
+
+    <span class="kd">public</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">ViewConfig</span><span class="o">&gt;</span> <span class="n">getCurrentViewConfigClass</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="n">viewConfigResolver</span><span class="o">.</span><span class="na">getViewConfigDescriptor</span><span class="o">(</span><span class="n">FacesContext</span><span class="o">.</span><span class="na">getCurrentInstance</span><span class="o">().</span><span class="na">getViewRoot</span><span class="o">().</span><span class="na">getViewId</span><span class="o">()).</span><span class="na">getConfigClass</span><span class="o">();</span>
+    <span class="o">}</span>
+    <span class="c1">//...</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>For folders it's optional to implement the <code>ViewConfig</code> interface, therefore you see 2 different types of API.
+<code>#getConfigDescriptor</code> as the general API and <code>#getViewConfigDescriptor</code> which is specific for pages (which have to implement the <code>ViewConfig</code> interface).</p>
+<p><strong>Besides</strong> translating a config class to the final path of the folder or page, it's possible to get the implicitly as well as explicitly configured (view-)meta-data and get and/or execute configured callbacks.</p>
+<h2 id="advanced-api-usages">Advanced API usages</h2>
+<p>[TODO]</p>
+<h3 id="creating-custom-meta-data-via-viewmetadata">Creating Custom Meta-Data via @ViewMetaData</h3>
+<p>This meta-annotation allows to create custom view-meta-data which can be used for view-configs. Per default meta-data of a lower level overrides meta-data on a higher level which has the same type. That can be customized via annotating the final annotation as a whole via <code>@Aggregated(true)</code>.</p>
+<div class="codehilite"><pre><span class="nd">@ViewMetaData</span>
+<span class="nd">@interface</span> <span class="n">InfoPage</span>
+<span class="o">{</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>By just using <code>@InfoPage</code> in view-configs, it can be queried via:</p>
+<div class="codehilite"><pre><span class="nd">@Inject</span>
+<span class="kd">private</span> <span class="n">ViewConfigResolver</span> <span class="n">viewConfigResolver</span><span class="o">;</span>
+<span class="c1">//...</span>
+
+<span class="n">ViewConfigDescriptor</span> <span class="n">viewConfigDescriptor</span> <span class="o">=</span> <span class="n">viewConfigResolver</span><span class="o">.</span><span class="na">getViewConfigDescriptor</span><span class="o">(</span><span class="n">Pages</span><span class="o">.</span><span class="na">Index</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+<span class="n">List</span><span class="o">&lt;</span><span class="n">InfoPage</span><span class="o">&gt;</span> <span class="n">metaDataList</span> <span class="o">=</span> <span class="n">viewConfigDescriptor</span><span class="o">.</span><span class="na">getMetaData</span><span class="o">(</span><span class="n">InfoPage</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+</pre></div>
+
+
+<h3 id="creating-custom-meta-data-via-stereotype">Creating Custom Meta-Data via @Stereotype</h3>
+<p>Like with CDI itself you can encapsulate multiple view meta-data annotation in one annotation.</p>
+<p>e.g.:</p>
+<div class="codehilite"><pre><span class="nd">@Target</span><span class="o">({</span><span class="n">TYPE</span><span class="o">})</span>
+<span class="nd">@Retention</span><span class="o">(</span><span class="n">RUNTIME</span><span class="o">)</span>
+
+<span class="nd">@Stereotype</span>
+<span class="nd">@Secured</span><span class="o">(</span><span class="n">CustomAccessDecisionVoter</span><span class="o">.</span><span class="na">class</span><span class="o">)</span> <span class="c1">//view meta-data #1</span>
+<span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span> <span class="o">=</span> <span class="n">REDIRECT</span><span class="o">)</span> <span class="c1">//view meta-data #2</span>
+<span class="nd">@interface</span> <span class="n">MySecuredView</span> <span class="o">{}</span>
+</pre></div>
+
+
+<p>Instead of using the same combination of annotations in multiple places, you can use the stereotype annotation.
+If you query the meta-data at runtime (see <code>ViewConfigDescriptor#getMetaData</code>), you can access <code>@Secured</code> as well as <code>@View</code> (in the example above). however, you won't see <code>@MySecuredView</code> itself at runtime, because stereotype annotations are per default transparent.</p>
+<p>Since v1.0.1+ it's possible to access such stereotype annotations as well, once you annotate them with <code>@ViewMetaData</code>.</p>
+<h3 id="creating-custom-callbacks-via-viewmetadata">Creating Custom Callbacks via @ViewMetaData</h3>
+<p>Via a custom ConfigPreProcessor it's possible to register custom callbacks dynamically.
+The following listing shows a view-config which adds a simple callback including the corresponding <code>ConfigPreProcessor</code> and <code>ExecutableCallbackDescriptor</code>.</p>
+<div class="codehilite"><pre><span class="nd">@ViewMetaData</span><span class="o">(</span><span class="n">preProcessor</span> <span class="o">=</span> <span class="n">MySecured</span><span class="o">.</span><span class="na">AnnotationPreProcessor</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+<span class="kd">public</span> <span class="nd">@interface</span> <span class="n">MySecured</span>
+<span class="o">{</span>
+    <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">TestAccessDecisionVoter</span><span class="o">&gt;[]</span> <span class="n">value</span><span class="o">();</span>
+
+    <span class="kd">class</span> <span class="nc">AnnotationPreProcessor</span> <span class="kd">implements</span> <span class="n">ConfigPreProcessor</span><span class="o">&lt;</span><span class="n">MySecured</span><span class="o">&gt;</span>
+    <span class="o">{</span>
+        <span class="nd">@Override</span>
+        <span class="kd">public</span> <span class="n">MySecured</span> <span class="nf">beforeAddToConfig</span><span class="o">(</span><span class="n">MySecured</span> <span class="n">metaData</span><span class="o">,</span> <span class="n">ViewConfigNode</span> <span class="n">viewConfigNode</span><span class="o">)</span>
+        <span class="o">{</span>
+            <span class="n">List</span><span class="o">&lt;</span><span class="n">CallbackDescriptor</span><span class="o">&gt;</span> <span class="n">descriptors</span> <span class="o">=</span> <span class="n">viewConfigNode</span><span class="o">.</span><span class="na">getCallbackDescriptors</span><span class="o">(</span><span class="n">MySecured</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+            <span class="n">descriptors</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">Descriptor</span><span class="o">(</span><span class="n">metaData</span><span class="o">.</span><span class="na">value</span><span class="o">(),</span> <span class="n">DefaultCallback</span><span class="o">.</span><span class="na">class</span><span class="o">));</span>
+            <span class="k">return</span> <span class="n">metaData</span><span class="o">;</span>
+        <span class="o">}</span>
+    <span class="o">}</span>
+
+    <span class="kd">static</span> <span class="kd">class</span> <span class="nc">Descriptor</span> <span class="kd">extends</span> <span class="n">ExecutableCallbackDescriptor</span><span class="o">&lt;</span><span class="n">Set</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;&gt;</span>
+    <span class="o">{</span>
+        <span class="kd">public</span> <span class="nf">Descriptor</span><span class="o">(</span><span class="n">Class</span><span class="o">[]</span> <span class="n">beanClasses</span><span class="o">,</span> <span class="n">Class</span><span class="o">&lt;?</span> <span class="kd">extends</span> <span class="n">Annotation</span><span class="o">&gt;</span> <span class="n">callbackMarker</span><span class="o">)</span>
+        <span class="o">{</span>
+            <span class="kd">super</span><span class="o">(</span><span class="n">beanClasses</span><span class="o">,</span> <span class="n">callbackMarker</span><span class="o">);</span>
+        <span class="o">}</span>
+
+        <span class="kd">public</span> <span class="n">List</span><span class="o">&lt;</span><span class="n">Set</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;&gt;</span> <span class="n">execute</span><span class="o">(</span><span class="n">String</span> <span class="n">param1</span><span class="o">,</span> <span class="n">String</span> <span class="n">param2</span><span class="o">)</span>
+        <span class="o">{</span>
+            <span class="k">return</span> <span class="kd">super</span><span class="o">.</span><span class="na">execute</span><span class="o">(</span><span class="n">param1</span><span class="o">,</span> <span class="n">param2</span><span class="o">);</span>

[... 481 lines stripped ...]


Mime
View raw message