You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by bu...@apache.org on 2014/06/12 16:51:50 UTC

svn commit: r912345 - in /websites/staging/deltaspike/trunk/content: ./ core.html jsf.html

Author: buildbot
Date: Thu Jun 12 14:51:49 2014
New Revision: 912345

Log:
Staging update by buildbot for deltaspike

Modified:
    websites/staging/deltaspike/trunk/content/   (props changed)
    websites/staging/deltaspike/trunk/content/core.html
    websites/staging/deltaspike/trunk/content/jsf.html

Propchange: websites/staging/deltaspike/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Jun 12 14:51:49 2014
@@ -1 +1 @@
-1601006
+1602186

Modified: websites/staging/deltaspike/trunk/content/core.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/core.html (original)
+++ websites/staging/deltaspike/trunk/content/core.html Thu Jun 12 14:51:49 2014
@@ -401,7 +401,7 @@ For such cases a custom ExpressionInterp
 <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="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>
 </pre></div>
 

Modified: websites/staging/deltaspike/trunk/content/jsf.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/jsf.html (original)
+++ websites/staging/deltaspike/trunk/content/jsf.html Thu Jun 12 14:51:49 2014
@@ -129,6 +129,7 @@
 <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>
@@ -206,7 +207,7 @@
 <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>
+<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 />
@@ -260,7 +261,7 @@ If it's not matching, the view will be r
 </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>
+<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>
@@ -388,6 +389,59 @@ The best way, to apply it for all views,
 </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>You can also use the same file to provide type-safe messages.</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.
@@ -620,7 +674,7 @@ On interfaces always use <code>@Folder</
 </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="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>