Author: mmcallis
Date: 2008-02-17 21:28:34 -0500 (Sun, 17 Feb 2008)
New Revision: 10009
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
Log:
periodic backup
revising 5.2.4. A simple MyFaces JSF Portlet on JBoss AS 4.2
*** this will break the book until later commits ***
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
===================================================================
---
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-18
01:52:50 UTC (rev 10008)
+++
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-18
02:28:34 UTC (rev 10009)
@@ -1348,14 +1348,15 @@
</sect3>
<sect3>
<title>Application Descriptors</title>
- <para>For the sake of brevity, we only discuss the
<literal>portlet.xml</literal>, <literal>web.xml</literal> and
- <literal>faces-config.xml</literal> descriptors here. For
discussion on the other descriptors, please
- view <xref linkend="first_portlet_descriptors"/> or the
chapter on descriptors:
- <xref linkend="descriptors_portlet"/>.
- <itemizedlist>
- <listitem>
- <para><literal>portlet.xml</literal>
-<programlisting><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>
+ <para>
+ For brevity, only the <filename>portlet.xml</filename>,
<filename>faces-config.xml</filename>, and
<filename>web.xml</filename> descriptors are described here. For more
information about application descriptors, refer to <xref
linkend="first_portlet_descriptors"/> and <xref
linkend="descriptors_portlet"/>.
+ </para>
+ <para>
+ The following is an example of the
<filename>HelloWorldJSFMyFaces42Portlet/WEB-INF/portlet.xml</filename> file.
This file must adhere to its definition in the JSR-168 Portlet Specification. You may
define more than one portlet application in this file:
+ </para>
+ <para>
+<screen><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
@@ -1376,36 +1377,65 @@
<title>HelloWorld JSF Portlet</title>
</portlet-info>
</portlet>
-</portlet-app>]]></programlisting>
- This file must adhere to its definition in the Portlet
Specification. You may define more than
- one portlet application in this file. Now let's look at the
portions that deal with our use of
- JSF:
- <itemizedlist>
- <listitem>
- <para>
-
<programlisting><![CDATA[<portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>]]></programlisting>
- Here we specify that MyFacesGenericPortlet will handle
all requests/responses from our
- users. There is therefore no need to develop a specific
portlet class, MyFaces
- providing a generic implementation bridging the JSF and
portlet worlds.
- <note>If you wanted to add more functionality to
your JSF portlet, not included in the
- MyFacesGenericPortlet, you could sublass it and
create your own Class.</note>
- </para>
- </listitem>
- <listitem>
- <para>
- We need to initialize the portlet with a default view
page for it to render, much like
- a welcome page:
- <programlisting><![CDATA[<init-param>
+</portlet-app>]]>
+</screen>
+</para>
+<para>
+ <variablelist>
+ <varlistentry><term><screen><![CDATA[
+<portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>]]>
+</screen></term>
+<listitem>
+ <para>
+ Here we specify that MyFacesGenericPortlet will handle all requests/responses from our
+ users. There is therefore no need to develop a specific portlet class, MyFaces
+ providing a generic implementation bridging the JSF and portlet worlds.
+ <note><para>If you wanted to add more functionality to your JSF portlet,
not included in the
+ MyFacesGenericPortlet, you could sublass it and create your own
Class.</para></note>
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<init-param>
<name>default-view</name>
<value>/WEB-INF/jsp/index.jsp</value>
-</init-param>]]></programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para><literal>web.xml</literal>
+</init-param>]]>
+</screen></term>
+<listitem>
+ <para>
+ We need to initialize the portlet with a default view page for it to render, much like
+ a welcome page:
+ </para>
+</listitem>
+</varlistentry>
+</variablelist>
+</para>
+<para>
+ The following is an example
<filename>HelloWorldJSFMyFaces42Portlet/WEB-INF/faces-config.xml</filename>
file:
+</para>
+<para>
+<screen><![CDATA[
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <description>Basic UserBean</description>
+ <managed-bean-name>user</managed-bean-name>
+
<managed-bean-class>org.jboss.portlet.hello.bean.User</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>done</from-outcome>
+ <to-view-id>/WEB-INF/jsp/result.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+</faces-config>]]>
+
+
+ <para><literal>web.xml</literal>
<programlisting><![CDATA[<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
<param-value>true</param-value>