Author: artdaw
Date: 2008-09-29 06:49:27 -0400 (Mon, 29 Sep 2008)
New Revision: 10593
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
https://jira.jboss.org/jira/browse/RF-3117 - info about Request Errors and Session
Expiration Handling was added to the Dev.Guide and FAQ
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-09-29 09:18:42 UTC (rev
10592)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-09-29 10:49:27 UTC (rev
10593)
@@ -2608,6 +2608,62 @@
</context-param>
...]]></programlisting>
</section>
+ <section id="sessionExpiredHandling">
+ <?dbhtml filename="sessionExpiredHandling.html"?>
+ <title>How to handle Request Errors and Session
Expiration?</title>
+ <para>
+ In order to redefine standard handlers responsible for processing of
different exceptional situations
+ you should take the following steps:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ add to your <property>web.xml</property> the following
code:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<context-param>
+ <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
+ <param-value>true</param-value>
+</context-param>
+...]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ add custom
<emphasis><property>"onError"</property></emphasis>,
<emphasis><property>"onExpire"</property></emphasis>
handlers:
+ </para>
+ <programlisting role="Java"><![CDATA[...
+A4J.AJAX.onError = function(req,status,message){
+ window.alert("Custom onError handler "+message);
+}
+A4J.AJAX.onExpired = function(loc,expiredMsg){
+ if(window.confirm("Custom onExpired handler "+expiredMsg+" for a
location: "+loc)){
+ return loc;
+ } else {
+ return false;
+ }
+}
+...]]></programlisting>
+ <para>
+ For the detailed description see
+ the <ulink
url="http://www.jboss.org/file-access/default/members/jbossrichfaces...
Errors and Session Expiration Handling</ulink> section of the Developer Guide.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <note>
+ <title>Note:</title>
+ <para>
+ Note that custom
<emphasis><property>"onError"</property></emphasis>,
<emphasis><property>"onExpire"</property></emphasis>
handlers
+ do not work under MyFaces. MyFaces handles exception by its internals generating
debug page.
+ You could use the following code to prevent such behavior:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<context-param>
+ <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
+ <param-value>false</param-value>
+</context-param>
+...]]></programlisting>
+ </note>
+ </section>
<section id="ajaxCookie">
<?dbhtml filename="ajaxCookie.html"?>
<title>How to add cookie in an AJAX Respond?</title>
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-09-29
09:18:42 UTC (rev 10592)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-09-29
10:49:27 UTC (rev 10593)
@@ -1210,7 +1210,7 @@
<para> To execute your own code on the client in case of an error during Ajax
request,
it's necessary to redefine the standard
<code>"A4J.AJAX.onError"</code> method: </para>
- <programlisting role="JAVA"><![CDATA[ A4J.AJAX.onError =
function(req,status,message){
+ <programlisting role="JAVA"><![CDATA[ A4J.AJAX.onError =
function(req, status, message){
window.alert("Custom onError handler "+message);
}]]></programlisting>
<para> The function defined this way accepts as parameters: </para>
@@ -1245,7 +1245,7 @@
</para>
<programlisting role="JAVA">
-<![CDATA[A4J.AJAX.onExpired = function(loc,expiredMsg){
+<![CDATA[A4J.AJAX.onExpired = function(loc, expiredMsg){
if(window.confirm("Custom onExpired handler "+expiredMsg+" for a
location: "+loc)){
return loc;
} else {
@@ -1267,6 +1267,20 @@
</emphasis> event. </para>
</listitem>
</itemizedlist>
+ <note>
+ <title>Note:</title>
+ <para>
+ Note that custom
<emphasis><property>"onError"</property></emphasis>,
<emphasis><property>"onExpire"</property></emphasis>
handlers
+ do not work under MyFaces. MyFaces handles exception by its internals generating
debug page.
+ You could use the following code to prevent such behavior:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<context-param>
+ <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
+ <param-value>false</param-value>
+</context-param>
+...]]></programlisting>
+ </note>
<!--note>
<title>Note:</title>
Until the version 1.0.5 the method can't be redefined on <emphasis >