Author: ppenicka
Date: 2012-11-02 12:54:24 -0400 (Fri, 02 Nov 2012)
New Revision: 8949
Modified:
epp/docs/branches/6.0/Reference_Guide/en-US/Revision_History.xml
epp/docs/branches/6.0/Reference_Guide/en-US/modules/PortalDevelopment/NavigationController.xml
Log:
BZ#794099 - added info about creation of custom error pages.
Modified: epp/docs/branches/6.0/Reference_Guide/en-US/Revision_History.xml
===================================================================
--- epp/docs/branches/6.0/Reference_Guide/en-US/Revision_History.xml 2012-11-02 16:50:23
UTC (rev 8948)
+++ epp/docs/branches/6.0/Reference_Guide/en-US/Revision_History.xml 2012-11-02 16:54:24
UTC (rev 8949)
@@ -8,6 +8,20 @@
<simpara>
<revhistory>
<revision>
+ <revnumber>6.0.0-16</revnumber>
+ <date>Fri Nov 2 2012</date>
+ <author>
+ <firstname>Petr</firstname>
+ <surname>Penicka</surname>
+ <email/>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>BZ#794099 - added info about creation of custom error
pages.</member>
+ </simplelist>
+ </revdescription>
+ </revision>
+ <revision>
<revnumber>6.0.0-14</revnumber>
<date>Thu Nov 1 2012</date>
<author>
Modified:
epp/docs/branches/6.0/Reference_Guide/en-US/modules/PortalDevelopment/NavigationController.xml
===================================================================
---
epp/docs/branches/6.0/Reference_Guide/en-US/modules/PortalDevelopment/NavigationController.xml 2012-11-02
16:50:23 UTC (rev 8948)
+++
epp/docs/branches/6.0/Reference_Guide/en-US/modules/PortalDevelopment/NavigationController.xml 2012-11-02
16:54:24 UTC (rev 8949)
@@ -391,6 +391,54 @@
</listitem>
</itemizedlist>
</section>
+ <section
id="sect-Reference_Guide-Creating_Custom_Error_Pages-Overview">
+ <title>Custom error pages</title>
+ <para>
+ When an HTML error code is returned as a response to a URL request (e.g. 404 Not
Found), JBoss Enterprise Portal Platform redirects users to a default error page where the
error code is displayed together with an explanatory message. To replace the default error
page with a customized one, the configuration explained below needs to be performed.
+ </para>
+ <procedure>
+ <title>Configuring redirection to custom error pages</title>
+ <step>
+ <para>
+ Create the actual error pages and place them in the
<filename>JPP_HOME/gatein/gatein.ear/portal.war/</filename> directory.
+ </para>
+ </step>
+ <step>
+ <para>
+ For each error code that shall have its custom error page, add the
<literal><error-page></literal> element to the
<filename>JPP_HOME/gatein/gatein.ear/portal.war/WEB-INF/web.xml</filename>
file. This element specifies what page is displayed when the particular error code is
returned.
+ </para>
+ <para>
+ The sample code below ensures that the <filename>my404.html</filename>
page is displayed when the 404 error code is returned.
+<programlisting language="XML"><![CDATA[
+<error-page>
+ <error-code>404</error-code>
+ <location>/my404.html</location>
+</error-page>
+]]></programlisting>
+ </para>
+ </step>
+ <step>
+ <para>
+ Specify the error page locations as static resources in the
<filename>JPP_HOME/standalone/configuration/gatein/controller.xml</filename>
file. The code sample below demonstrates this configuration for the
<filename>/my404.html</filename> path.
+<programlisting language="XML"><![CDATA[
+<route path="/my404.html">
+ <route-param qname="gtn:handler">
+ <value>staticResource</value>
+ </route-param>
+</route>
+]]></programlisting>
+ </para>
+ <para>
+ Without this configuration, the portal tries to resolve
<filename>/my404.html</filename> as a name of a portal or another resource.
This results in unwanted redirection to
<filename>/portal/my404.html</filename>. It is therefore necessary to
configure the error page locations as static resources.
+ </para>
+ </step>
+ <step>
+ <para>
+ When all the previous steps are performed, users are redirected to the specified
custom error pages when the respective error codes are returned as a response to a URL
request.
+ </para>
+ </step>
+ </procedure>
+ </section>
</section>
</section>
<section
id="sect-Reference_Guide-Navigation_Controller_-Integrate_to_JBoss_Enterprise_Portal_Platform_WebUI_framework">