Author: manaRH
Date: 2008-09-11 11:14:27 -0400 (Thu, 11 Sep 2008)
New Revision: 8984
Added:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Seam_Reference_Guide_CP02_FP01.ent
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Seam_Reference_Guide_CP02_FP01.xml
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/Makefile
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Book_Info.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Components.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Dependencies.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Getting_Started_With_JBoss_Tools.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Groovy.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Hsearch.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/I18n.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Itext.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Persistence.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Revision_History.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Security.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Spring.xml
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Tutorial.xml
Log:
added released docs from EAP 4.3.2.1
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/Makefile
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/Makefile 2008-09-11
15:12:07 UTC (rev 8983)
+++ branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/Makefile 2008-09-11
15:14:27 UTC (rev 8984)
@@ -3,13 +3,10 @@
#Copyright Red Hat Inc. 2006
XML_LANG = en-US
-DOCNAME = Seam_Reference_Guide
-PRODUCT = Seam_Framework
+
BRAND = JBoss
-TRANSLATIONS = $(XML_LANG)
OTHER_LANGS = as-IN bn-IN de-DE es-ES fr-FR gu-IN hi-IN it-IT ja-JP kn-IN ko-KR ml-IN
mr-IN or-IN pa-IN pt-BR ru-RU si-LK sl-SL ta-IN te-IN zh-CN zh-TW
-#TRANSLATIONS = $(XML_LANG) $(OTHER_LANGS)
COMMON_CONFIG = /usr/share/publican
include $(COMMON_CONFIG)/make/Makefile.common
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Book_Info.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Book_Info.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Book_Info.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -1,10 +1,31 @@
-<?xml version="1.0" standalone="no"?>
+<?xml version='1.0'?>
<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
-<bookinfo>
- <title>Seam - Contextual Components</title>
- <subtitle>A Framework for Enterprise Java</subtitle>
- <xi:include href="Version_Info.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+<bookinfo id="Seam_Reference_Guide-Seam___Contextual_Components">
+ <title>Seam Reference Guide CP02 FP01</title>
+ <subtitle>for Use with JBoss Enterprise Application Platform 4.3.0 Cumulative
Patch 2 Feature Pack 1</subtitle>
+ <edition>2.0</edition>
+ <pubsnumber>2</pubsnumber>
+ <productname>JBoss Enterprise Application Platform</productname>
+ <productnumber>4.3</productnumber>
+ <pubdate>August, 2008</pubdate>
+ <isbn>N/A</isbn>
+ <abstract><para>This book is a Reference Guide to Seam 2.0.2 for JBoss
Enterprise Application Platform 4.3.0_CP02_FP01</para>
+ </abstract>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="Common_Content/images/redhat-logo.svg" />
+ </imageobject>
+ </inlinemediaobject>
+ </corpauthor>
+ <copyright>
+ <year>&YEAR;</year>
+ <holder>&HOLDER;</holder>
+ </copyright>
+ <xi:include href="Common_Content/Legal_Notice.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Author_Group.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</bookinfo>
- <xi:include href="Author_Group.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
-</bookinfo>
+
+
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Components.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Components.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Components.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -1521,38 +1521,38 @@
</itemizedlist>
</listitem>
</varlistentry>
- <varlistentry>
+ <!-- <varlistentry>
<term><emphasis><entityHome></emphasis></term>
-
<term><literal>org.jboss.seam.framework.EntityHome</literal></term>
- <listitem>
- <para></para>
+
<term><literal>org.jboss.seam.framework.EntityHome</literal></term>
-->
+ <!-- <listitem>
+ <para></para> -->
<!-- TODO: Document this -->
- </listitem>
- </varlistentry>
- <varlistentry>
+ <!-- </listitem> -->
+ <!-- </varlistentry> -->
+<!-- <varlistentry>
<term><emphasis><hibernateEntityHome></emphasis></term>
-
<term><literal>org.jboss.seam.framework.HibernateEntityHome</literal></term>
- <listitem>
- <para></para>
+ <term><literal>org.jboss.seam.framework.HibernateEntityHome</literal></term>
-->
+ <!-- <listitem>
+ <para></para> -->
<!-- TODO: Document this -->
- </listitem>
- </varlistentry>
- <varlistentry>
+ <!-- </listitem> -->
+ <!-- </varlistentry> -->
+ <!-- <varlistentry>
<term><emphasis><entityQuery></emphasis></term>
-
<term><literal>org.jboss.seam.framework.EntityQuery</literal></term>
- <listitem>
- <para></para>
+ <term><literal>org.jboss.seam.framework.EntityQuery</literal></term>
-->
+ <!-- <listitem>
+ <para></para> -->
<!-- TODO: Document this -->
- </listitem>
- </varlistentry>
- <varlistentry>
+ <!-- </listitem> -->
+ <!-- </varlistentry> -->
+ <!-- <varlistentry>
<term><emphasis><hibernateEntityQuery></emphasis></term>
-
<term><literal>org.jboss.seam.framework.HibernateEntityQuery</literal></term>
- <listitem>
- <para></para>
+ <term><literal>org.jboss.seam.framework.HibernateEntityQuery</literal></term>
-->
+ <!-- <listitem>
+ <para></para> -->
<!-- TODO: Document this -->
- </listitem>
- </varlistentry>
+ <!-- </listitem> -->
+ <!-- </varlistentry> -->
</variablelist>
</section>
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Dependencies.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Dependencies.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Dependencies.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -31,10 +31,10 @@
<para>
<table><title></title>
<tgroup cols="4">
- <colspec colnum="1" colwidth="4*" />
+ <!-- <colspec colnum="1" colwidth="4*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="3*" />
- <colspec colnum="4" colwidth="5*" />
+ <colspec colnum="4" colwidth="5*" /> -->
<thead>
<row>
@@ -153,7 +153,7 @@
<para>provided</para>
</entry>
<entry align="center">
- <para></para>
+ <!-- <para></para> -->
</entry>
<entry>
<para>JSF API</para>
@@ -168,7 +168,7 @@
<para>provided</para>
</entry>
<entry align="center">
- <para></para>
+ <!-- <para></para> -->
</entry>
<entry>
<para>JSF Reference Implementation</para>
@@ -233,10 +233,10 @@
<title>RichFaces dependencies</title>
<tgroup cols="4">
- <colspec colnum="1" colwidth="4*" />
+ <!-- <colspec colnum="1" colwidth="4*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="3*" />
- <colspec colnum="4" colwidth="5*" />
+ <colspec colnum="4" colwidth="5*" /> -->
<thead>
<row>
@@ -317,10 +317,10 @@
<title>Seam Mail Dependencies</title>
<tgroup cols="4">
- <colspec colnum="1" colwidth="4*" />
+ <!-- <colspec colnum="1" colwidth="4*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="3*" />
- <colspec colnum="4" colwidth="5*" />
+ <colspec colnum="4" colwidth="5*" /> -->
<thead>
<row>
@@ -379,7 +379,7 @@
<para>compile only</para>
</entry>
<entry align="center">
- <para></para>
+ <!-- <para></para> -->
</entry>
<entry>
<para>Required for incoming mail support</para>
@@ -415,10 +415,10 @@
<title>Seam PDF Dependencies</title>
<tgroup cols="4">
- <colspec colnum="1" colwidth="4*" />
+ <!-- <colspec colnum="1" colwidth="4*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="3*" />
- <colspec colnum="4" colwidth="5*" />
+ <colspec colnum="4" colwidth="5*" /> -->
<thead>
<row>
@@ -515,10 +515,10 @@
<title>JBoss Rules Dependencies</title>
<tgroup cols="4">
- <colspec colnum="1" colwidth="4*" />
+ <!-- <colspec colnum="1" colwidth="4*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="3*" />
- <colspec colnum="4" colwidth="5*" />
+ <colspec colnum="4" colwidth="5*" /> -->
<thead>
<row>
@@ -580,8 +580,8 @@
<para>ear</para>
</entry>
<entry>
- <para></para>
- </entry>
+ <!-- <para></para> -->
+ </entry>
</row>
<row>
@@ -595,8 +595,8 @@
<para>ear</para>
</entry>
<entry>
- <para></para>
- </entry>
+ <!-- <para></para> -->
+ </entry>
</row>
<row>
@@ -609,9 +609,9 @@
<entry align="center">
<para>ear</para>
</entry>
- <entry>
- <para></para>
- </entry>
+ <entry>
+ <!-- <para></para> -->
+ </entry>
</row>
<row>
@@ -625,8 +625,8 @@
<para>ear</para>
</entry>
<entry>
- <para></para>
- </entry>
+ <!-- <para></para> -->
+ </entry>
</row>
</tbody>
@@ -642,10 +642,10 @@
<title>JBPM dependencies</title>
<tgroup cols="4">
- <colspec colnum="1" colwidth="4*" />
+ <!-- <colspec colnum="1" colwidth="4*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="3*" />
- <colspec colnum="4" colwidth="5*" />
+ <colspec colnum="4" colwidth="5*" /> -->
<thead>
<row>
@@ -677,8 +677,8 @@
<para>ear</para>
</entry>
<entry>
- <para></para>
- </entry>
+ <!-- <para></para> -->
+ </entry>
</row>
</tbody>
@@ -703,10 +703,10 @@
<title>GWT dependencies</title>
<tgroup cols="4">
- <colspec colnum="1" colwidth="4*" />
+ <!-- <colspec colnum="1" colwidth="4*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="3*" />
- <colspec colnum="4" colwidth="5*" />
+ <colspec colnum="4" colwidth="5*" /> -->
<thead>
<row>
@@ -763,10 +763,10 @@
<title>Spring Framework dependencies</title>
<tgroup cols="4">
- <colspec colnum="1" colwidth="4*" />
+ <!-- <colspec colnum="1" colwidth="4*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="3*" />
- <colspec colnum="4" colwidth="5*" />
+ <colspec colnum="4" colwidth="5*" /> -->
<thead>
<row>
@@ -823,11 +823,11 @@
<title>Groovy dependencies</title>
<tgroup cols="4">
- <colspec colnum="1" colwidth="4*" />
+ <!-- <colspec colnum="1" colwidth="4*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="3*" />
- <colspec colnum="4" colwidth="5*" />
-
+ <colspec colnum="4" colwidth="5*" /> -->
+
<thead>
<row>
<entry align="center">
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Getting_Started_With_JBoss_Tools.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Getting_Started_With_JBoss_Tools.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Getting_Started_With_JBoss_Tools.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -146,7 +146,7 @@
<para>
The next 3 screens allow you to further customize your new project, but
- for us the defaults are fine. So just hit <empahsis>Next</empahsis>
+ for us the defaults are fine. So just hit <emphasis>Next</emphasis>
until you reach the final screen.
</para>
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Groovy.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Groovy.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Groovy.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -137,7 +137,6 @@
}
}</programlisting>
- <para/>
</section>
</section>
@@ -205,7 +204,6 @@
</listitem>
</itemizedlist>
- <para/>
</section>
<section>
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Hsearch.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Hsearch.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Hsearch.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -205,13 +205,12 @@
[...]
}]]></programlisting>
- <para></para>
- <caution>
+ <important>
<para>For people accustomed to Hibernate Search out of Seam, note that
using <methodname>Search.createFullTextSession</methodname> is not
necessary.</para>
- </caution>
+ </important>
<para>Check the DVDStore or the blog examples of the JBoss Seam
distribution for a concrete use of Hibernate Search.</para>
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/I18n.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/I18n.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++ branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/I18n.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -71,8 +71,7 @@
</para>
<para>
- You can write your translation of labels
- (<xlink linkend="labels">Labels</xlink>) to your
messages resource
+ You can write your translation of labels to your messages resource
bundle in the native encoding and then convert the content of the
file into the escaped format through the tool
<literal>native2ascii</literal>
provided in the JDK. This tool will convert a file written in your
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Itext.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Itext.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Itext.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -23,8 +23,8 @@
<informaltable>
<tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
+ <!-- <colspec colnum="1" colwidth="1*"/> -->
+ <!-- <colspec colnum="2" colwidth="3*"/> -->
<tbody>
@@ -160,8 +160,8 @@
<informaltable>
<tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
+ <!-- <colspec colnum="1" colwidth="1*"/> -->
+ <!-- <colspec colnum="2" colwidth="3*"/> -->
<tbody>
<row>
@@ -594,8 +594,8 @@
<informaltable>
<tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
+ <!-- <colspec colnum="1" colwidth="1*"/> -->
+ <!-- <colspec colnum="2" colwidth="3*"/> -->
<tbody>
<row>
@@ -708,12 +708,12 @@
<informaltable>
<tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
+ <!-- <colspec colnum="1" colwidth="1*"/> -->
+ <!-- <colspec colnum="2" colwidth="3*"/> -->
<tbody>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:chapter></literal>
</para>
@@ -721,7 +721,7 @@
<literal><p:section></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -784,12 +784,12 @@
</entry>
</row>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:header></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -828,17 +828,17 @@
<informaltable>
<tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
+ <!-- <colspec colnum="1" colwidth="1*"/>
-->
+ <!-- <colspec colnum="2" colwidth="3*"/>
-->
<tbody>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:list></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<!--
<para>
<emphasis>Description</emphasis>
@@ -899,12 +899,12 @@
</entry>
</row>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:listItem></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -981,17 +981,17 @@
<informaltable>
<tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
+ <!-- <colspec colnum="1" colwidth="1*"/> -->
+ <!-- <colspec colnum="2" colwidth="3*"/> -->
<tbody>
<row>
- <entry valign="top">
- <para>
+ <entry valign="top">
+ <para>
<literal><p:table></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -1136,12 +1136,12 @@
</entry>
</row>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:cell></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -1393,17 +1393,17 @@
<informaltable id="itext.barchart">
<tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
+ <!-- <colspec colnum="1" colwidth="1*"/> -->
+ <!-- <colspec colnum="2" colwidth="3*"/> -->
<tbody>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:barchart></literal>
</para>
- </entry>
- <entry valign="top">
+ </entry>
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -1597,12 +1597,12 @@
</entry>
</row>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:linechart></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -1796,12 +1796,12 @@
</entry>
</row>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:piechart></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -1948,12 +1948,12 @@
</entry>
</row>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:series></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -2023,12 +2023,12 @@
</entry>
</row>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:data></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -2088,12 +2088,12 @@
</entry>
</row>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:color></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -2137,12 +2137,12 @@
</entry>
</row>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:stroke></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -2212,17 +2212,17 @@
<informaltable id="itext.barcode">
<tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
+ <!-- <colspec colnum="1" colwidth="1*"/> -->
+ <!-- <colspec colnum="2" colwidth="3*"/> -->
<tbody>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:barCode></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
@@ -2330,17 +2330,17 @@
<informaltable id="itext.swing">
<tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
+ <!-- <colspec colnum="1" colwidth="1*"/>
+ <colspec colnum="2" colwidth="3*"/> -->
<tbody>
<row>
- <entry valign="top">
+ <entry valign="top">
<para>
<literal><p:swing></literal>
</para>
</entry>
- <entry valign="top">
+ <entry valign="top">
<para>
<emphasis>Description</emphasis>
</para>
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -90,13 +90,13 @@
<para>The JSF RI doesn't require you to specify a
listener.</para>
- <tip>
+ <note>
<para>
Due to an incompatibility between Seam and MyFaces, you had to
use client side state saving in Seam 1.2. Switching to the JSF RI
1.2 lifts this restriction.
</para>
- </tip>
+ </note>
</section>
@@ -273,7 +273,7 @@
<literal>SeamTest</literal> will automatically start the
container.
</para>
- <tip>
+ <warning>
<para>
You must order the classpath correctly when using Embedded with
<literal>SeamTest</literal>. Make sure the jars in
@@ -281,7 +281,7 @@
For example, when using Ant, they should be declared above any
other libraries in the test classpath.
</para>
- </tip>
+ </warning>
<para>
If you want to run tests using the Eclipse TestNG plugin, you'll
@@ -310,14 +310,14 @@
<section id="migrating.general">
<title>Updating your code</title>
- <tip>
+ <important>
<para>
Don't forget to update the XSD's in
<literal>pages.xml</literal> and
<literal>components.xml</literal> to point at the ones for Seam
2.
Just change the suffix from <literal>-1.2.xml</literal> to
<literal>-2.0.xml</literal>.
</para>
- </tip>
+ </important>
<section>
<title>Built-in Component changes</title>
@@ -397,12 +397,12 @@
<table>
<title>Component's in Seam 2</title>
<tgroup cols="2">
- <colspec colnum="1" colwidth="2*" />
+ <!-- <colspec colnum="1" colwidth="2*" />
<colspec colnum="2" colwidth="2*" />
<colspec colnum="3" colwidth="2*" />
<colspec colnum="4" colwidth="2*" />
<colspec colnum="5" colwidth="2*" />
- <colspec colnum="6" colwidth="2*" />
+ <colspec colnum="6" colwidth="2*" /> -->
<thead>
<row>
@@ -1260,12 +1260,12 @@
<programlisting role="XML"><![CDATA[<service
name="tx" factory="org.jbpm.tx.TxServiceFactory"
/>]]></programlisting>
- <tip>
+ <note>
<para>
You don't need to do this if you are just using jBPM for
pageflows.
</para>
- </tip>
+ </note>
</section>
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Persistence.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Persistence.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Persistence.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -240,9 +240,8 @@
<literal>persistence:managed-persistence-context</literal>
component. If your managed persistence context is named
<literal>entityManager</literal>, you can
opt to leave out the <literal>entity-manager</literal> attribute. (see
- <link
linkend="persistence.seam-managed-persistence-contexts">Seam-managed
persistence contexts</link>
- )
- </para>
+ <xref
linkend="persistence.seam-managed-persistence-contexts"/>Seam-managed
persistence contexts)
+ </para>
<programlisting
role="XML"><![CDATA[<transaction:entity-transaction
entity-manager="#{em}"/>]]></programlisting>
<para>
To configure Hibernate managed transactions declare the following in your
components.xml where
@@ -251,8 +250,7 @@
<literal>persistence:managed-hibernate-session</literal>
component. If your managed hibernate session is named
<literal>session</literal>, you can
opt to leave out the <literal>session</literal> attribute. (see
- <link
linkend="persistence.seam-managed-persistence-contexts">Seam-managed
persistence contexts</link>
- )
+ <xref
linkend="persistence.seam-managed-persistence-contexts"/>Seam-managed
persistence contexts)
</para>
<programlisting
role="XML"><![CDATA[<transaction:hibernate-transaction
session="#{hibernateSession}"/>]]></programlisting>
<para>
@@ -261,7 +259,7 @@
<programlisting
role="XML"><![CDATA[<transaction:no-transaction
/>]]></programlisting>
<para>
For configuring Spring managed transactions see
- <link linkend="spring-transactions">using Spring
PlatformTransactionManagement</link>
+ <xref linkend="spring-transactions"/>using Spring
PlatformTransactionManagement.
.
</para>
</section>
@@ -485,7 +483,7 @@
vendor is Hibernate, and the most powerful delegate interface is
<literal>org.hibernate.Session</literal>. You'd be nuts to
use anything else. Trust
me, I'm not biased at all. If you must use a different JPA provider see
- <link linkend="alt-jpa-providers">Using Alternate JPA
Providers</link>.
+ <xref linkend="alt-jpa-providers"/>Using Alternate JPA
Providers.
</para>
<para>
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Revision_History.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Revision_History.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Revision_History.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -1,7 +1,9 @@
<?xml version='1.0'?>
<!DOCTYPE revhistory PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
-
+<appendix id="appe-Publican-Revision_History">
+ <title>Revision History</title>
+ <simpara>
<revhistory>
<revision>
@@ -20,4 +22,5 @@
</revdescription>
</revision>
</revhistory>
-
+</simpara>
+</appendix>
Added:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Seam_Reference_Guide_CP02_FP01.ent
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Seam_Reference_Guide_CP02_FP01.ent
(rev 0)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Seam_Reference_Guide_CP02_FP01.ent 2008-09-11
15:14:27 UTC (rev 8984)
@@ -0,0 +1,3 @@
+<!ENTITY HOLDER "Red Hat, Inc">
+<!ENTITY YEAR "2008">
+<!ENTITY VERSION "4.3.0_CP02_FP01">
Added:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Seam_Reference_Guide_CP02_FP01.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Seam_Reference_Guide_CP02_FP01.xml
(rev 0)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Seam_Reference_Guide_CP02_FP01.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
+<book>
+ <xi:include href="Book_Info.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Preface.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Tutorial.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Gettingstarted.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Getting_Started_With_JBoss_Tools.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Migration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Concepts.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Xml.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Events.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Conversations.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Jbpm.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Persistence.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Validation.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Groovy.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Framework.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Drools.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Security.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "I18n.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Text.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Itext.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Mail.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Jms.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Cache.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Webservices.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Remoting.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Spring.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Hsearch.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Annotations.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Components.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Controls.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Elenhancements.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Testing.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Tools.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Dependencies.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="Revision_History.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</book>
Property changes on:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Seam_Reference_Guide_CP02_FP01.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Security.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Security.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Security.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -528,8 +528,8 @@
<title>Security Message Keys</title>
<tgroup cols="2">
- <colspec colnum="1" colwidth="2*" />
- <colspec colnum="2" colwidth="3*" />
+ <!-- <colspec colnum="1" colwidth="2*" />
+ <colspec colnum="2" colwidth="3*" /> -->
<thead>
<row>
@@ -1393,8 +1393,8 @@
<title>Security Events</title>
<tgroup cols="2">
- <colspec colnum="1" colwidth="3*" />
- <colspec colnum="2" colwidth="2*" />
+ <!-- <colspec colnum="1" colwidth="3*" />
+ <colspec colnum="2" colwidth="2*" /> -->
<thead>
<row>
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Spring.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Spring.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Spring.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -106,7 +106,7 @@
<para> This example shows one way to use a Seam-managed persistence context
from a Spring bean. (For a more robust
way to use Seam-managed persistence contexts as a replacement for the Spring
<literal>OpenEntityManagerInView</literal> filter see section
on
- <link linkend="spring-persistence">Using a Seam Managed
Persistence Context in Spring</link>)</para>
+ <xref linkend="spring-persistence"/>Using a Seam Managed
Persistence Context in Spring)</para>
</section>
<section>
@@ -230,7 +230,7 @@
transaction management exposes support for many advanced features such as nested
transactions and supports full Java EE transaction propagation rules like
REQUIRES_NEW and NOT_SUPPORTED. For more
information see the spring documentation
- <ulink
url="http://static.springframework.org/spring/docs/2.0.x/reference/t...
+ <ulink
url="http://static.springframework.org/spring/docs/2.0.x/reference/t...
<para>To configure Seam to use Spring transactions enable the
SpringTransaction component like so:</para>
@@ -330,7 +330,7 @@
<title>Using a Seam Managed Hibernate Session in Spring</title>
<para>The Seam Spring integration also provides support for complete access
to a Seam managed Hibernate session
- using spring's tools. This integration is very similar to the <link
linkend="spring-persistence">JPA integration</link>.</para>
+ using spring's tools. This integration is very similar to the <xref
linkend="spring-persistence"/>JPA integration.</para>
<para>Like Spring's JPA integration spring's propagation model
allows only one open EntityManager per
EntityManagerFactory per transaction??? to be available to spring tools. So, the
Seam Session integration works
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Tutorial.xml
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Tutorial.xml 2008-09-11
15:12:07 UTC (rev 8983)
+++
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Tutorial.xml 2008-09-11
15:14:27 UTC (rev 8984)
@@ -59,7 +59,7 @@
First, make sure you have Ant correctly installed, with
<literal>$ANT_HOME</literal> and
<literal>$JAVA_HOME</literal> set correctly. Next, make sure
you set the location of your Tomcat
6.0 installation in the <literal>build.properties</literal>
file in the root folder of your Seam
- installation. You will need to follow the instructions in <xref
linkend="config.install.embedded"/>
+ installation. You will need to follow the instructions in embedded
installation configuration section of this book
for installing JBoss Embedded on Tomcat 6.0. JBoss Embedded is required
to run the Seam demo
applications on Tomcat. (However, it is possible to use Seam on Tomcat
without JBoss Embedded.)
</para>
@@ -143,18 +143,8 @@
<!-- Can't use code hightlighting with callouts -->
<example>
<title></title>
- <programlistingco>
- <areaspec>
-
- <area id="registration-name-annotation"
coords="2"/>
- <area id="registration-scope-annotation"
coords="3"/>
- <area id="registration-table-annotation"
coords="4"/>
- <area id="registration-attributes"
coords="9"/>
- <area id="registration-empty-constructor"
coords="20"/>
- <area id="registration-notnull"
coords="22"/>
- <area id="registration-id-annotation"
coords="44"/>
- </areaspec>
- <programlisting role="JAVA"><![CDATA[@Entity
<co id="registration-entity-annotation"/>
+ <programlisting role="JAVA">
+@Entity <co id="registration-entity-annotation"/>
@Name("user")
@Scope(SESSION)
@Table(name="users")
@@ -208,59 +198,47 @@
this.username = username;
}
-}]]></programlisting>
- <calloutlist>
- <callout
arearefs="registration-entity-annotation">
+}</programlisting>
+
<para> The EJB3 standard
<literal>@Entity</literal> annotation indicates that the
<literal>User</literal> class is an
entity bean. </para>
- </callout>
- <callout
arearefs="registration-name-annotation">
+
<para> A Seam component needs a
<emphasis>component name</emphasis> specified by the
- <link linkend="name-annotation">
<literal>@Name</literal>
- </link> annotation. This name must be unique
within the Seam application. When JSF
+ annotation. This name must be unique within the Seam
application. When JSF
asks Seam to resolve a context variable with a name
that is the same as a Seam
component name, and the context variable is currently
undefined (null), Seam will
instantiate that component, and bind the new instance
to the context variable. In
this case, Seam will instantiate a
<literal>User</literal> the first time JSF
encounters a variable named
<literal>user</literal>. </para>
- </callout>
- <callout
arearefs="registration-scope-annotation">
+
<para> Whenever Seam instantiates a component, it
binds the new instance to a context
variable in the component's
<emphasis>default context</emphasis>. The default
- context is specified using the <link
linkend="scope-annotation">
+ context is specified using the
<literal>@Scope</literal>
- </link> annotation. The
<literal>User</literal> bean is a session scoped component.
+ annotation. The <literal>User</literal>
bean is a session scoped component.
</para>
- </callout>
- <callout
arearefs="registration-table-annotation">
+
<para> The EJB standard
<literal>@Table</literal> annotation indicates that the
<literal>User</literal> class is
mapped to the <literal>users</literal> table.
</para>
- </callout>
- <callout arearefs="registration-attributes">
+
<para>
<literal>name</literal>,
<literal>password</literal> and <literal>username</literal>
are the persistent attributes of the entity bean. All
of our persistent attributes
define accessor methods. These are needed when this
component is used by JSF in the
render response and update model values phases.
</para>
- </callout>
- <callout
arearefs="registration-empty-constructor">
+
<para> An empty constructor is both required by
both the EJB specification and by Seam.
</para>
- </callout>
- <callout arearefs="registration-notnull">
+
<para> The <literal>@NotNull</literal>
and <literal>@Length</literal> annotations are
part of the Hibernate Validator framework. Seam
integrates Hibernate Validator and
lets you use it for data validation (even if you are
not using Hibernate for
persistence). </para>
- </callout>
- <callout
arearefs="registration-id-annotation">
+
<para> The EJB standard
<literal>@Id</literal> annotation indicates the primary key
attribute of the entity bean. </para>
- </callout>
- </calloutlist>
- </programlistingco>
</example>
<para> The most important things to notice in this example are
the <literal>@Name</literal> and
<literal>@Scope</literal> annotations. These
annotations establish that this class is a Seam component. </para>
@@ -287,19 +265,9 @@
<!-- Can't use code hightlighting with callouts -->
<example>
<title></title>
- <programlistingco>
- <areaspec>
- <area id="registration-stateless-annotation"
coords="1"/>
- <area id="registration-in-annotation"
coords="6"/>
- <area
id="registration-persistencecontext-annotation" coords="9"/>
- <area id="registration-logger-annotation"
coords="12"/>
- <area id="registration-action-listener"
coords="15"/>
- <area id="registration-query"
coords="18"/>
- <area id="registration-log"
coords="24"/>
- <area id="registration-outcome"
coords="25"/>
- <area id="registration-builtin"
coords="29"/>
- </areaspec>
- <programlisting><![CDATA[@Stateless
+
+ <programlisting>
+@Stateless
@Name("register")
public class RegisterAction implements Register
{
@@ -332,45 +300,37 @@
}
}
-}]]></programlisting>
+}</programlisting>
- <calloutlist>
- <callout
arearefs="registration-stateless-annotation">
+
<para> The EJB standard
<literal>@Stateless</literal> annotation marks this class as
a stateless session bean. </para>
- </callout>
- <callout
arearefs="registration-in-annotation">
- <para> The <link
linkend="in-annotation">
+
+ <para> The
<literal>@In</literal>
- </link> annotation marks an attribute of the
bean as injected by Seam. In this case,
+ annotation marks an attribute of the bean as
injected by Seam. In this case,
the attribute is injected from a context variable
named <literal>user</literal> (the
instance variable name). </para>
- </callout>
- <callout
arearefs="registration-persistencecontext-annotation">
+
<para> The EJB standard
<literal>@PersistenceContext</literal> annotation is used to
inject the EJB3 entity manager. </para>
- </callout>
- <callout
arearefs="registration-logger-annotation">
+
<para> The Seam
<literal>@Logger</literal> annotation is used to inject the component's
<literal>Log</literal> instance.
</para>
- </callout>
- <callout
arearefs="registration-action-listener">
+
<para> The action listener method uses the standard
EJB3
<literal>EntityManager</literal> API to
interact with the database, and returns the
JSF outcome. Note that, since this is a session bean,
a transaction is automatically
begun when the
<literal>register()</literal> method is called, and committed when it
completes. </para>
- </callout>
- <callout arearefs="registration-query">
+
<para> Notice that Seam lets you use a JSF EL
expression inside EJB-QL. Under the
covers, this results in an ordinary JPA
<literal>setParameter()</literal> call on
the standard JPA <literal>Query</literal>
object. Nice, huh? </para>
- </callout>
- <callout arearefs="registration-log">
+
<para> The <literal>Log</literal> API
lets us easily display templated log messages.
</para>
- </callout>
- <callout arearefs="registration-outcome">
+
<para> JSF action listener methods return a
string-valued outcome that determines what
page will be displayed next. A null outcome (or a
void action listener method)
redisplays the previous page. In plain JSF, it is
normal to always use a JSF
@@ -381,16 +341,12 @@
that when you use a view id as an outcome, Seam
always performs a browser
redirect.</emphasis>
</para>
- </callout>
- <callout arearefs="registration-builtin">
+
<para> Seam provides a number of
<emphasis>built-in components</emphasis> to help solve
common problems. The
<literal>FacesMessages</literal> component makes it easy to
display templated error or success messages. Built-in
Seam components may be
obtained by injection, or by calling an
<literal>instance()</literal> method.
</para>
- </callout>
- </calloutlist>
- </programlistingco>
</example>
<para> Note that we did not explicitly specify a
<literal>@Scope</literal> this time. Each Seam
@@ -418,11 +374,12 @@
<para>Naturally, our session bean needs a local
interface.</para>
<example><title></title>
- <programlisting role="JAVA"><![CDATA[@Local
+ <programlisting role="JAVA">
+@Local
public interface Register
{
public String register();
-}]]></programlisting></example>
+}</programlisting></example>
<para> That's the end of the Java code. Now onto the deployment
descriptors. </para>
@@ -446,17 +403,18 @@
Seam how to find our EJB components in JNDI: </para>
<example>
<title></title>
- <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
-<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML">
+<?xml version="1.0" encoding="UTF-8"?>
+<components
xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.1.xsd
-
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.1.xsd">
+
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.1.xsd">
- <core:init jndi-pattern="@jndiPattern@"/>
+ <core:init jndi-pattern="@jndiPattern@"/>
-</components>]]></programlisting></example>
+</components> </programlisting></example>
<para> This code configures a property named
<literal>jndiPattern</literal> of a built-in Seam component
named <literal>org.jboss.seam.core.init</literal>. The
funny <literal>@</literal> symbols are
@@ -470,46 +428,47 @@
<para> The presentation layer for our mini-application will be
deployed in a WAR. So we'll need a web
deployment descriptor. </para>
<example><title></title>
- <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
-<web-app version="2.5"
+ <programlisting role="XML">
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
-
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<!-- Seam -->
- <listener>
- <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
- </listener>
+ <listener>
+
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
<!-- JSF -->
- <listener>
-
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
- </listener>
+ <listener>
+
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
- <context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.seam</url-pattern>
- </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
- <session-config>
- <session-timeout>10</session-timeout>
- </session-config>
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
-</web-app>]]></programlisting></example>
+</web-app></programlisting></example>
<para> This <literal>web.xml</literal> file configures
Seam and JSF. The configuration you see here is
@@ -526,18 +485,19 @@
<example>
<title></title>
- <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
-<faces-config version="1.2"
+ <programlisting role="XML">
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<!-- Facelets support -->
- <application>
- <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
- </application>
+ <application>
+
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
-</faces-config>]]></programlisting>
+</faces-config></programlisting>
</example>
@@ -561,26 +521,27 @@
<para> The <literal>ejb-jar.xml</literal> file
integrates Seam with EJB3, by attaching the
<literal>SeamInterceptor</literal> to all session
beans in the archive. </para>
- <programlisting role="XML"><![CDATA[<ejb-jar
xmlns="http://java.sun.com/xml/ns/javaee"
+ <programlisting role="XML">
+<ejb-jar
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
- version="3.0">
+ version="3.0">
- <interceptors>
- <interceptor>
-
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
- </interceptor>
- </interceptors>
+<interceptors>
+ <interceptor>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+</interceptors>
- <assembly-descriptor>
- <interceptor-binding>
- <ejb-name>*</ejb-name>
-
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
- </interceptor-binding>
- </assembly-descriptor>
+<assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+</assembly-descriptor>
-</ejb-jar>]]></programlisting>
+</ejb-jar></programlisting>
</section>
@@ -591,22 +552,23 @@
datasource, and contains some vendor-specific settings. In this case,
enables automatic schema
export at startup time. </para>
- <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
-<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
+ <programlisting role="XML">
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
- version="1.0">
+ version="1.0">
- <persistence-unit name="userDatabase">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <jta-data-source>java:/DefaultDS</jta-data-source>
- <properties>
- <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
- </properties>
- </persistence-unit>
+<persistence-unit name="userDatabase">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop">
+ </properties>
+</persistence-unit>
-</persistence>]]></programlisting>
+</persistence></programlisting>
</section>
@@ -618,34 +580,35 @@
<example>
<title></title>
- <programlisting role="XHTML"><![CDATA[<?xml
version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
+ <programlisting role="XHTML">
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core">
+
xmlns:f="http://java.sun.com/jsf/core">
- <head>
- <title>Register New User</title>
- </head>
- <body>
- <f:view>
- <h:form>
- <s:validateAll>
- <h:panelGrid columns="2">
- Username: <h:inputText value="#{user.username}"
required="true"/>
- Real Name: <h:inputText value="#{user.name}"
required="true"/>
- Password: <h:inputSecret value="#{user.password}"
required="true"/>
- </h:panelGrid>
- </s:validateAll>
- <h:messages/>
- <h:commandButton value="Register"
action="#{register.register}"/>
- </h:form>
- </f:view>
- </body>
+<head>
+ <title>Register New User</title>
+</head>
+<body>
+ <f:view>
+ <h:form>
+ <s:validateAll>
+ <h:panelGrid columns="2">
+ Username: <h:inputText value="#{user.username}"
required="true"/>
+ Real Name: <h:inputText value="#{user.name}"
required="true"/>
+ Password: <h:inputSecret value="#{user.password}"
required="true"/>
+ </h:panelGrid>
+ </s:validateAll>
+ <h:messages/>
+ <h:commandButton value="Register"
action="#{register.register}"/>
+ </h:form>
+ </f:view>
+</body>
-</html>]]></programlisting></example>
+</html></programlisting></example>
<para> The only thing here that is specific to Seam is the
@@ -654,23 +617,21 @@
<example>
<title></title>
- <programlisting role="XHTML"><![CDATA[<?xml
version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:f="http://java.sun.com/jsf/core">
+ <programlisting role="XHTML">
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"xmlns:f="http://java.s...
- <head>
- <title>Successfully Registered New User</title>
- </head>
- <body>
- <f:view>
- Welcome, #{user.name}, you are successfully registered as #{user.username}.
- </f:view>
- </body>
+<head>
+<title>Successfully Registered New User</title>
+</head>
+<body>
+ <f:view>
+ Welcome, #{user.name}, you are successfully registered as #{user.username}.
+ </f:view>
+</body>
-</html>
-]]></programlisting>
+ </html></programlisting>
</example>
@@ -685,32 +646,33 @@
<para> Finally, since our application is deployed as an EAR, we
need a deployment descriptor there, too. </para>
<example
id="registration-application-xml"><title>registration
application</title>
- <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
-<application
xmlns="http://java.sun.com/xml/ns/javaee"
+ <programlisting role="XML">
+<?xml version="1.0" encoding="UTF-8"?>
+<application
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_5.xsd"
- version="5">
+ version="5">
- <display-name>Seam Registration</display-name>
+<display-name>Seam Registration</display-name>
- <module>
- <web>
- <web-uri>jboss-seam-registration.war</web-uri>
- <context-root>/seam-registration</context-root>
- </web>
- </module>
- <module>
- <ejb>jboss-seam-registration.jar</ejb>
- </module>
- <module>
- <ejb>jboss-seam.jar</ejb>
- </module>
- <module>
- <java>jboss-el.jar</java>
- </module>
+<module>
+ <web>
+ <web-uri>jboss-seam-registration.war</web-uri>
+ <context-root>/seam-registration</context-root>
+ </web>
+</module>
+<module>
+ <ejb>jboss-seam-registration.jar</ejb>
+</module>
+<module>
+ <ejb>jboss-seam.jar</ejb>
+</module>
+<module>
+ <java>jboss-el.jar</java>
+</module>
-</application>]]></programlisting>
+ </application></programlisting>
</example>
<para> This deployment descriptor links modules in the enterprise
archive and binds the web application
@@ -780,7 +742,8 @@
<example>
<title></title>
- <programlisting role="JAVA"><![CDATA[@Entity
+ <programlisting role="JAVA">
+@Entity
@Name("message")
@Scope(EVENT)
public class Message implements Serializable
@@ -832,7 +795,7 @@
this.datetime = datetime;
}
-}]]></programlisting>
+}</programlisting>
</example>
</section>
@@ -856,25 +819,15 @@
<!-- Can't use code hightlighting with callouts -->
<example>
<title></title>
- <programlistingco>
- <areaspec>
- <area id="messages-datamodel"
coords="7"/>
- <area id="messages-datamodelselection"
coords="10"/>
- <area id="messages-out"
coords="11"/>
- <area id="messages-persistencecontext"
coords="14"/>
- <area id="messages-factory"
coords="17"/>
- <area id="messages-select"
coords="24"/>
- <area id="messages-delete"
coords="29"/>
- <area id="messages-remove"
coords="36"/>
- </areaspec>
- <programlisting><![CDATA[@Stateful
+ <programlisting>
+@Stateful
@Scope(SESSION)
@Name("messageManager")
public class MessageManagerBean implements Serializable, MessageManager
{
@DataModel
- private List<Message> messageList;
+ private List<Message> messageList;
@DataModelSelection
@Out(required=false)
@@ -905,57 +858,46 @@
@Remove
public void destroy() {}
-}]]></programlisting>
- <calloutlist>
- <callout arearefs="messages-datamodel">
+}</programlisting>
+
<para> The
<literal>@DataModel</literal> annotation exposes an attibute of type
<literal>java.util.List</literal> to
the JSF page as an instance of
<literal>javax.faces.model.DataModel</literal>. This allows us to use the
list
in a JSF
<literal><h:dataTable></literal> with clickable links for
each row. In this case, the
<literal>DataModel</literal> is made available in a
session context variable named
<literal>messageList</literal>. </para>
- </callout>
- <callout
arearefs="messages-datamodelselection">
+
<para> The
<literal>@DataModelSelection</literal> annotation tells Seam to inject the
<literal>List</literal> element that
corresponded to the clicked link. </para>
- </callout>
- <callout arearefs="messages-out">
+
<para> The <literal>@Out</literal>
annotation then exposes the selected value directly
to the page. So ever time a row of the clickable list
is selected, the
<literal>Message</literal> is
injected to the attribute of the stateful bean,
and the subsequently
<emphasis>outjected</emphasis> to the event context variable
named <literal>message</literal>.
</para>
- </callout>
- <callout
arearefs="messages-persistencecontext">
+
<para> This stateful bean has an EJB3
<emphasis>extended persistence context</emphasis>.
The messages retrieved in the query remain in the
managed state as long as the bean
exists, so any subsequent method calls to the
stateful bean can update them without
needing to make any explicit call to the
<literal>EntityManager</literal>. </para>
- </callout>
- <callout arearefs="messages-factory">
+
<para> The first time we navigate to the JSP page,
there will be no value in the
<literal>messageList</literal>
context variable. The <literal>@Factory</literal>
annotation tells Seam to create an instance of
<literal>MessageManagerBean</literal>
and invoke the
<literal>findMessages()</literal> method to initialize the value. We
call <literal>findMessages()</literal> a
<emphasis>factory method</emphasis> for
<literal>messages</literal>.
</para>
- </callout>
- <callout arearefs="messages-select">
+
<para> The <literal>select()</literal>
action listener method marks the selected
<literal>Message</literal> as read,
and updates it in the database. </para>
- </callout>
- <callout arearefs="messages-delete">
+
<para> The <literal>delete()</literal>
action listener method removes the selected
<literal>Message</literal> from the
database. </para>
- </callout>
- <callout arearefs="messages-remove">
+
<para> All stateful session bean Seam components
<emphasis>must</emphasis> have a method
with no parameters marked
<literal>@Remove</literal> that Seam uses to remove
the stateful bean when the Seam context ends, and
clean up any server-side state.
</para>
- </callout>
- </calloutlist>
- </programlistingco>
</example>
<para> Note that this is a session-scoped Seam component. It is
associated with the user login session,
@@ -969,14 +911,15 @@
<para> All session beans have a business interface, of course.
</para>
- <programlisting role="JAVA"><![CDATA[@Local
+ <programlisting role="JAVA">
+@Local
public interface MessageManager
{
public void findMessages();
public void select();
public void delete();
public void destroy();
-}]]></programlisting>
+}</programlisting>
<para> From now on, we won't show local interfaces in our code
examples. </para>
@@ -994,50 +937,51 @@
component. Again, nothing specific to Seam. </para>
<example>
<title></title>
- <programlisting role="XHTML"><![CDATA[<%@
taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
-<html>
- <head>
- <title>Messages</title>
- </head>
- <body>
- <f:view>
- <h:form>
- <h2>Message List</h2>
- <h:outputText value="No messages to display"
- rendered="#{messageList.rowCount==0}"/>
- <h:dataTable var="msg" value="#{messageList}"
- rendered="#{messageList.rowCount>0}">
- <h:column>
- <f:facet name="header">
- <h:outputText value="Read"/>
- </f:facet>
- <h:selectBooleanCheckbox value="#{msg.read}"
disabled="true"/>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Title"/>
- </f:facet>
- <h:commandLink value="#{msg.title}"
action="#{messageManager.select}"/>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Date/Time"/>
- </f:facet>
- <h:outputText value="#{msg.datetime}">
- <f:convertDateTime type="both" dateStyle="medium"
timeStyle="short"/>
- </h:outputText>
- </h:column>
- <h:column>
- <h:commandButton value="Delete"
action="#{messageManager.delete}"/>
- </h:column>
- </h:dataTable>
- <h3><h:outputText value="#{message.title}"/></h3>
- <div><h:outputText value="#{message.text}"/></div>
- </h:form>
- </f:view>
- </body>
-</html>]]></programlisting>
+ <programlisting role="XHTML">
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"
%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"
%>
+<html>
+ <head>
+ <title>Messages</title>
+ </head>
+ <body>
+ <f:view>
+ <h:form>
+ <h2>Message List</h2>
+ <h:outputText value="No messages to display"
+ rendered="#{messageList.rowCount==0}"/>
+ <h:dataTable var="msg" value="#{messageList}"
+ rendered="#{messageList.rowCount>0}">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Read"/>
+ </f:facet>
+ <h:selectBooleanCheckbox value="#{msg.read}"
disabled="true"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Title"/>
+ </f:facet>
+ <h:commandLink value="#{msg.title}"
action="#{messageManager.select}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Date/Time"/>
+ </f:facet>
+ <h:outputText value="#{msg.datetime}">
+ <f:convertDateTime type="both" dateStyle="medium"
timeStyle="short"/>
+ </h:outputText>
+ </h:column>
+ <h:column>
+ <h:commandButton value="Delete"
action="#{messageManager.delete}"/>
+ </h:column>
+ </h:dataTable>
+ <h3><h:outputTex>
value="#{message.title}"/></h3>
+ <div><h:outputText
value="#{message.text}"/></div>
+ </h:form>
+ </f:view>
+ </body>
+</html></programlisting>
</example>
@@ -1103,60 +1047,45 @@
<!-- Can't use code hightlighting with callouts -->
<example>
<title></title>
- <programlistingco>
- <areaspec>
- <area id="todo-startstate"
coords="3"/>
- <area id="todo-tasknode" coords="7"/>
- <area id="todo-task" coords="8"/>
- <area id="todo-assignment"
coords="9"/>
- <area id="todo-endstate" coords="14"/>
- </areaspec>
- <programlisting><![CDATA[<process-definition
name="todo">
+ <programlisting>
+<process-definition name="todo">
- <start-state name="start">
- <transition to="todo"/>
- </start-state>
+<start-state name="start">
+<transition to="todo"/>
+</start-state>
- <task-node name="todo">
- <task name="todo" description="#{todoList.description}">
- <assignment actor-id="#{actor.id}"/>
- </task>
- <transition to="done"/>
- </task-node>
+<task-node name="todo">
+<task name="todo"
description="#{todoList.description}">
+<assignment actor-id="#{actor.id}"/>
+</task>
+<transition to="done"/>
+</task-node>
- <end-state name="done"/>
+<end-state name="done"/>
-</process-definition>]]></programlisting>
- <calloutlist>
- <callout arearefs="todo-startstate">
+</process-definition></programlisting>
+
<para> The
<literal><start-state></literal> node represents the logical
start
of the process. When the process starts, it immediately
transitions to the
<literal>todo</literal> node. </para>
- </callout>
- <callout arearefs="todo-tasknode">
+
<para> The
<literal><task-node></literal> node represents a
<emphasis>wait
state</emphasis>, where business process
execution pauses, waiting for one or more
tasks to be performed. </para>
- </callout>
- <callout arearefs="todo-task">
+
<para> The
<literal><task></literal> element defines a task to be performed
by
a user. Since there is only one task defined on this
node, when it is complete,
execution resumes, and we transition to the end state.
The task gets its description
from a Seam component named
<literal>todoList</literal> (one of the JavaBeans). </para>
- </callout>
- <callout arearefs="todo-assignment">
+
<para> Tasks need to be assigned to a user or group of
users when they are created. In this
case, the task is assigned to the current user, which we
get from a built-in Seam
component named <literal>actor</literal>. Any
Seam component may be used to perform task
assignment. </para>
- </callout>
- <callout arearefs="todo-endstate">
+
<para> The
<literal><end-state></literal> node defines the logical end of
the
business process. When execution reaches this node, the
process instance is destroyed.
</para>
- </callout>
- </calloutlist>
- </programlistingco>
</example>
@@ -1181,7 +1110,8 @@
would also need to authenticate the user.) </para>
<example>
<title></title>
- <programlisting
role="JAVA"><![CDATA[@Name("login")
+ <programlisting role="JAVA">
+@Name("login")
public class Login {
@In
@@ -1202,7 +1132,7 @@
actor.setId(user);
return "/todo.jsp";
}
-}]]></programlisting>
+}</programlisting>
</example>
@@ -1211,24 +1141,25 @@
<para> The JSP itself is trivial: </para>
- <programlisting role="XHTML"><![CDATA[<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
-<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
-<html>
-<head>
-<title>Login</title>
-</head>
-<body>
-<h1>Login</h1>
-<f:view>
- <h:form>
- <div>
- <h:inputText value="#{login.user}"/>
- <h:commandButton value="Login"
action="#{login.login}"/>
- </div>
- </h:form>
-</f:view>
-</body>
-</html>]]></programlisting>
+ <programlisting role="XHTML">
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core"
prefix="f"%>
+<html>
+ <head>
+ <title>Login</title>
+ </head>
+ <body>
+ <h1>Login</h1>
+ <f:view>
+ <h:form>
+ <div>
+ <h:inputText value="#{login.user}"/>
+ <h:commandButton value="Login"
action="#{login.login}"/>
+ </div>
+ </h:form>
+ </f:view>
+ </body>
+</html></programlisting>
@@ -1237,13 +1168,8 @@
<!-- Can't use code hightlighting with callouts -->
<example>
<title></title>
- <programlistingco>
- <areaspec>
- <area id="todo-description"
coords="6"/>
- <area id="todo-createprocess-annotation"
coords="15"/>
- <area id="todo-task-annotations"
coords="18"/>
- </areaspec>
- <programlisting><![CDATA[@Name("todoList")
+ <programlisting>
+@Name("todoList")
public class TodoList {
private String description;
@@ -1263,23 +1189,17 @@
@StartTask @EndTask
public void done() {}
-}]]></programlisting>
- <calloutlist>
- <callout arearefs="todo-description">
+}</programlisting>
+
<para> The description property accepts user input form
the JSP page, and exposes it to the
process definition, allowing the task description to be
set. </para>
- </callout>
- <callout
arearefs="todo-createprocess-annotation">
+
<para> The Seam
<literal>@CreateProcess</literal> annotation creates a new jBPM process
instance for the named process definition. </para>
- </callout>
- <callout arearefs="todo-task-annotations">
+
<para> The Seam
<literal>@StartTask</literal> annotation starts work on a task. The
<literal>@EndTask</literal> ends the
task, and allows the business process execution
to resume. </para>
- </callout>
- </calloutlist>
- </programlistingco>
</example>
@@ -1290,71 +1210,72 @@
<para> Finally, the meat of the application is in
<literal>todo.jsp</literal>: </para>
<example>
<title></title>
- <programlisting role="XHTML"><![CDATA[<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
-<%@ taglib
uri="http://jboss.com/products/seam/taglib" prefix="s"
%>
-<html>
-<head>
-<title>Todo List</title>
-</head>
-<body>
-<h1>Todo List</h1>
-<f:view>
- <h:form id="list">
- <div>
- <h:outputText value="There are no todo items."
- rendered="#{empty taskInstanceList}"/>
- <h:dataTable value="#{taskInstanceList}" var="task"
- rendered="#{not empty taskInstanceList}">
- <h:column>
- <f:facet name="header">
- <h:outputText value="Description"/>
- </f:facet>
- <h:inputText value="#{task.description}"/>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Created"/>
- </f:facet>
- <h:outputText
value="#{task.taskMgmtInstance.processInstance.start}">
- <f:convertDateTime type="date"/>
- </h:outputText>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Priority"/>
- </f:facet>
- <h:inputText value="#{task.priority}" style="width:
30"/>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Due Date"/>
- </f:facet>
- <h:inputText value="#{task.dueDate}" style="width:
100">
- <f:convertDateTime type="date"
dateStyle="short"/>
- </h:inputText>
- </h:column>
- <h:column>
- <s:button value="Done" action="#{todoList.done}"
taskInstance="#{task}"/>
- </h:column>
- </h:dataTable>
- </div>
- <div>
- <h:messages/>
- </div>
- <div>
- <h:commandButton value="Update Items"
action="update"/>
- </div>
- </h:form>
- <h:form id="new">
- <div>
- <h:inputText value="#{todoList.description}"/>
- <h:commandButton value="Create New Item"
action="#{todoList.createTodo}"/>
- </div>
- </h:form>
-</f:view>
-</body>
-</html>]]></programlisting>
+ <programlisting role="XHTML">
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"
%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"
%>
+<%@ taglib
uri="http://jboss.com/products/seam/taglib"
prefix="s" %>
+<html>
+ <head>
+ <title>Todo List</title>
+ </head>
+ <body>
+ <h1>Todo List</h1>
+ <f:view>
+ <h:form id="list">
+ <div>
+ <h:outputText value="There are no todo items."
+ rendered="#{empty taskInstanceList}"/>
+ <h:dataTable value="#{taskInstanceList}" var="task"
+ rendered="#{not empty taskInstanceList}">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Description"/>
+ </f:facet>
+ <h:inputText value="#{task.description}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Created"/>
+ </f:facet>
+ <h:outputText
value="#{task.taskMgmtInstance.processInstance.start}">
+ <f:convertDateTime type="date"/>
+ </h:outputText>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Priority"/>
+ </f:facet>
+ <h:inputText value="#{task.priority}" style="width:
30"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Due Date"/>
+ </f:facet>
+ <h:inputText value="#{task.dueDate}" style="width:
100">
+ <f:convertDateTime type="date" dateStyle="short"/>
+ </h:inputText>
+ </h:column>
+ <h:column>
+ <s:button value="Done" action="#{todoList.done}"
taskInstance="#{task}"/>
+ </h:column>
+ </h:dataTable>
+ </div>
+ <div>
+ <h:messages/>
+ </div>
+ <div>
+ <h:commandButton value="Update Items"
action="update"/>
+ </div>
+ </h:form>
+ <h:form id="new">
+ <div>
+ <h:inputText value="#{todoList.description}"/>
+ <h:commandButton value="Create New Item"
action="#{todoList.createTodo}"/>
+ </div>
+ </h:form>
+ </f:view>
+ </body>
+</html></programlisting>
</example>
@@ -1364,57 +1285,60 @@
<literal>taskInstanceList</literal>. The list is defined
inside a JSF form. </para>
<example>
<title></title>
- <programlisting role="XHTML"><![CDATA[<h:form
id="list">
- <div>
- <h:outputText value="There are no todo items." rendered="#{empty
taskInstanceList}"/>
- <h:dataTable value="#{taskInstanceList}" var="task"
- rendered="#{not empty taskInstanceList}">
+ <programlisting role="XHTML">
+<h:form id="list">
+<div>
+ <h:outputText value="There are no todo items." rendered="#{empty
taskInstanceList}"/>
+ <h:dataTable value="#{taskInstanceList}" var="task"
+ rendered="#{not empty taskInstanceList}">
...
- </h:dataTable>
- </div>
-</h:form>]]></programlisting>
+ </h:dataTable>
+</div>
+</h:form></programlisting>
</example>
<para> Each element of the list is an instance of the jBPM class
<literal>TaskInstance</literal>. The
following code simply displays the interesting properties of each task in
the list. For the description,
priority and due date, we use input controls, to allow the user to update
these values. </para>
- <programlisting role="XHTML"><![CDATA[<h:column>
- <f:facet name="header">
- <h:outputText value="Description"/>
- </f:facet>
- <h:inputText value="#{task.description}"/>
-</h:column>
-<h:column>
- <f:facet name="header">
- <h:outputText value="Created"/>
- </f:facet>
- <h:outputText
value="#{task.taskMgmtInstance.processInstance.start}">
- <f:convertDateTime type="date"/>
- </h:outputText>
-</h:column>
-<h:column>
- <f:facet name="header">
- <h:outputText value="Priority"/>
- </f:facet>
- <h:inputText value="#{task.priority}" style="width: 30"/>
-</h:column>
-<h:column>
- <f:facet name="header">
- <h:outputText value="Due Date"/>
- </f:facet>
- <h:inputText value="#{task.dueDate}" style="width: 100">
- <f:convertDateTime type="date" dateStyle="short"/>
- </h:inputText>
-</h:column>]]></programlisting>
+ <programlisting role="XHTML">
+<h:column>
+ <f:facet name="header">
+ <h:outputText value="Description"/>
+ </f:facet>
+ <h:inputText value="#{task.description}"/>
+</h:column>
+<h:column>
+ <f:facet name="header">
+ <h:outputText value="Created"/>
+ </f:facet>
+ <h:outputText
value="#{task.taskMgmtInstance.processInstance.start}">
+ <f:convertDateTime type="date"/>
+ </h:outputText>
+</h:column>
+<h:column>
+ <f:facet name="header">
+ <h:outputText value="Priority"/>
+ </f:facet>
+ <h:inputText value="#{task.priority}" style="width:
30"/>
+</h:column>
+<h:column>
+ <f:facet name="header">
+ <h:outputText value="Due Date"/>
+ </f:facet>
+ <h:inputText value="#{task.dueDate}" style="width:
100">
+ <f:convertDateTime type="date" dateStyle="short"/>
+ </h:inputText>
+</h:column></programlisting>
<para> This button ends the task by calling the action method annotated
<literal>@StartTask
@EndTask</literal>. It passes the task id to Seam as a request
parameter: </para>
- <programlisting role="XHTML"><![CDATA[<h:column>
- <s:button value="Done" action="#{todoList.done}"
taskInstance="#{task}"/>
-</h:column>]]></programlisting>
+ <programlisting role="XHTML">
+<h:column>
+ <s:button value="Done" action="#{todoList.done}"
taskInstance="#{task}"/>
+</h:column></programlisting>
<para> (Note that this is using a Seam
<literal><s:button></literal> JSF control from the
<literal>seam-ui.jar</literal> package.) </para>
@@ -1422,17 +1346,20 @@
<para> This button is used to update the properties of the tasks. When
the form is submitted, Seam and jBPM
will make any changes to the tasks persistent. There is no need for any
action listener method: </para>
- <programlisting role="XHTML"><![CDATA[<h:commandButton
value="Update Items"
action="update"/>]]></programlisting>
+ <programlisting role="XHTML">
+<h:commandButton value="Update Items"
action="update"/>
+ </programlisting>
<para> A second form on the page is used to create new items, by
calling the action method annotated
<literal>@CreateProcess</literal>. </para>
- <programlisting role="XHTML"><![CDATA[<h:form
id="new">
- <div>
- <h:inputText value="#{todoList.description}"/>
- <h:commandButton value="Create New Item"
action="#{todoList.createTodo}"/>
- </div>
-</h:form>]]></programlisting>
+ <programlisting role="XHTML">
+<h:form id="new">
+ <div>
+ <h:inputText value="#{todoList.description}"/>
+ <h:commandButton value="Create New Item"
action="#{todoList.createTodo}"/>
+ </div>
+</h:form></programlisting>
<para> There are several other files needed for the example, but they
are just standard jBPM and Seam
configuration and not very interesting. </para>
@@ -1473,80 +1400,67 @@
<!-- Can't use code hightlighting with callouts -->
<example>
<title></title>
- <programlistingco>
- <areaspec>
- <area id="numberguess-page" coords="8"/>
- <area id="numberguess-transition"
coords="10"/>
- <area id="numberguess-action"
coords="11"/>
- <area id="numberguess-decision"
coords="16"/>
- </areaspec>
- <programlisting><![CDATA[<pageflow-definition
+ <programlisting>
+<pageflow-definition
xmlns="http://jboss.com/products/seam/pageflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pageflow
http://jboss.com/products/seam/pageflow-2.1.xsd"
- name="numberGuess">
+ name="numberGuess">
- <start-page name="displayGuess"
view-id="/numberGuess.jspx">
- <redirect/>
- <transition name="guess" to="evaluateGuess">
- <action expression="#{numberGuess.guess}"/>
- </transition>
- <transition name="giveup" to="giveup"/>
- </start-page>
+<start-page name="displayGuess"
view-id="/numberGuess.jspx">
+ <redirect/>
+ <transition name="guess" to="evaluateGuess">
+ <action expression="#{numberGuess.guess}"/>
+ </transition>
+ <transition name="giveup" to="giveup"/>
+ </start-page>
- <decision name="evaluateGuess"
expression="#{numberGuess.correctGuess}">
- <transition name="true" to="win"/>
- <transition name="false" to="evaluateRemainingGuesses"/>
- </decision>
+ <decision name="evaluateGuess"
expression="#{numberGuess.correctGuess}">
+ <transition name="true" to="win"/>
+ <transition name="false"
to="evaluateRemainingGuesses"/>
+ </decision>
- <decision name="evaluateRemainingGuesses"
expression="#{numberGuess.lastGuess}">
- <transition name="true" to="lose"/>
- <transition name="false" to="displayGuess"/>
- </decision>
+ <decision name="evaluateRemainingGuesses"
expression="#{numberGuess.lastGuess}">
+ <transition name="true" to="lose"/>
+ <transition name="false" to="displayGuess"/>
+ </decision>
- <page name="giveup" view-id="/giveup.jspx">
- <redirect/>
- <transition name="yes" to="lose"/>
- <transition name="no" to="displayGuess"/>
- </page>
+ <page name="giveup" view-id="/giveup.jspx">
+ <redirect/>
+ <transition name="yes" to="lose"/>
+ <transition name="no" to="displayGuess"/>
+ </page>
- <page name="win" view-id="/win.jspx">
- <redirect/>
- <end-conversation/>
- </page>
+ <page name="win" view-id="/win.jspx">
+ <redirect/>
+ <end-conversation/>
+ </page>
- <page name="lose" view-id="/lose.jspx">
- <redirect/>
- <end-conversation/>
- </page>
+ <page name="lose" view-id="/lose.jspx">
+ <redirect/>
+ <end-conversation/>
+ </page>
-</pageflow-definition>]]></programlisting>
- <calloutlist>
- <callout arearefs="numberguess-page">
+</pageflow-definition></programlisting>
+
<para> The
<literal><page></literal> element defines a wait state where
the
system displays a particular JSF view and waits for user
input. The
<literal>view-id</literal> is the same JSF
view id used in plain JSF navigation rules.
The <literal>redirect</literal> attribute
tells Seam to use post-then-redirect when
navigating to the page. (This results in friendly browser
URLs.) </para>
- </callout>
- <callout arearefs="numberguess-transition">
+
<para> The
<literal><transition></literal> element names a JSF outcome.
The
transition is triggered when a JSF action results in that
outcome. Execution will then
proceed to the next node of the pageflow graph, after
invocation of any jBPM transition
actions. </para>
- </callout>
- <callout arearefs="numberguess-action">
+
<para> A transition
<literal><action></literal> is just like a JSF action,
except that it occurs when a jBPM transition occurs. The
transition action can invoke
any Seam component. </para>
- </callout>
- <callout arearefs="numberguess-decision">
+
<para> A
<literal><decision></literal> node branches the pageflow, and
determines the next node to execute by evaluating a JSF
EL expression. </para>
- </callout>
- </calloutlist>
- </programlistingco>
</example>
@@ -1567,76 +1481,76 @@
<example>
<title></title>
- <programlisting role="XHTML"><![CDATA[<<?xml
version="1.0"?>
-<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
+ <programlisting role="XHTML">
+<?xml version="1.0"?>
+<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns="http://www.w3.org/1999/xhtml"
- version="2.0">
- <jsp:output doctype-root-element="html"
+ version="2.0">
+<jsp:output doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
-
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional...
- <jsp:directive.page contentType="text/html"/>
- <html>
- <head>
- <title>Guess a number...</title>
- <link href="niceforms.css" rel="stylesheet"
type="text/css" />
- <script language="javascript" type="text/javascript"
src="niceforms.js" />
- </head>
- <body>
- <h1>Guess a number...</h1>
- <f:view>
- <h:form styleClass="niceform">
+
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional...
+<jsp:directive.page contentType="text/html"/>
+<html>
+ <head>
+ <title>Guess a number...</title>
+ <link href="niceforms.css" rel="stylesheet"
type="text/css" />
+ <script language="javascript" type="text/javascript"
src="niceforms.js" />
+ </head>
+ <body>
+ <h1>Guess a number...</h1>
+ <f:view>
+ <h:form styleClass="niceform">
- <div>
- <h:messages globalOnly="true"/>
- <h:outputText value="Higher!"
- rendered="#{numberGuess.randomNumber gt
numberGuess.currentGuess}"/>
- <h:outputText value="Lower!"
- rendered="#{numberGuess.randomNumber lt
numberGuess.currentGuess}"/>
- </div>
+ <div>
+ <h:messages globalOnly="true"/>
+ <h:outputText value="Higher!"
rendered="#{numberGuess.randomNumber gt numberGuess.currentGuess}"/>
+ <h:outputText value="Lower!"
+rendered="#{numberGuess.randomNumber lt numberGuess.currentGuess}"/>
+ </div>
- <div>
+ <div>
I'm thinking of a number between
- <h:outputText value="#{numberGuess.smallest}"/> and
- <h:outputText value="#{numberGuess.biggest}"/>. You have
- <h:outputText value="#{numberGuess.remainingGuesses}"/> guesses.
- </div>
+ <h:outputText value="#{numberGuess.smallest}"/> and
+ <h:outputText value="#{numberGuess.biggest}"/>. You have
+ <h:outputText value="#{numberGuess.remainingGuesses}"/>
guesses.
+ </div>
- <div>
+ <div>
Your guess:
- <h:inputText value="#{numberGuess.currentGuess}"
id="inputGuess"
+ <h:inputText value="#{numberGuess.currentGuess}"
id="inputGuess"
required="true" size="3"
- rendered="#{(numberGuess.biggest-numberGuess.smallest) gt
20}">
- <f:validateLongRange maximum="#{numberGuess.biggest}"
- minimum="#{numberGuess.smallest}"/>
- </h:inputText>
- <h:selectOneMenu value="#{numberGuess.currentGuess}"
+ rendered="#{(numberGuess.biggest-numberGuess.smallest) gt 20}">
+ <f:validateLongRange maximum="#{numberGuess.biggest}"
+ minimum="#{numberGuess.smallest}"/>
+ </h:inputText>
+ <h:selectOneMenu value="#{numberGuess.currentGuess}"
id="selectGuessMenu" required="true"
rendered="#{(numberGuess.biggest-numberGuess.smallest) le
20 and
- (numberGuess.biggest-numberGuess.smallest) gt
4}">
- <s:selectItems value="#{numberGuess.possibilities}"
var="i" label="#{i}"/>
- </h:selectOneMenu>
- <h:selectOneRadio value="#{numberGuess.currentGuess}"
id="selectGuessRadio"
+ (numberGuess.biggest-numberGuess.smallest) gt 4}">
+ <s:selectItems value="#{numberGuess.possibilities}" var="i"
label="#{i}"/>
+ </h:selectOneMenu>
+ <h:selectOneRadio value="#{numberGuess.currentGuess}"
id="selectGuessRadio"
required="true"
- rendered="#{(numberGuess.biggest-numberGuess.smallest) le
4}">
- <s:selectItems value="#{numberGuess.possibilities}"
var="i" label="#{i}"/>
- </h:selectOneRadio>
- <h:commandButton value="Guess" action="guess"/>
- <s:button value="Cheat" view="/confirm.jspx"/>
- <s:button value="Give up" action="giveup"/>
- </div>
+ rendered="#{(numberGuess.biggest-numberGuess.smallest) le 4}">
+ <s:selectItems value="#{numberGuess.possibilities}" var="i"
label="#{i}"/>
+ </h:selectOneRadio>
+ <h:commandButton value="Guess" action="guess"/>
+ <s:button value="Cheat" view="/confirm.jspx"/>
+ <s:button value="Give up" action="giveup"/>
+ </div>
- <div>
- <h:message for="inputGuess" style="color: red"/>
- </div>
+ <div>
+ <h:message for="inputGuess" style="color: red"/>
+ </div>
- </h:form>
- </f:view>
- </body>
- </html>
-</jsp:root>]]></programlisting>
+ </h:form>
+ </f:view>
+ </body>
+</html>
+</jsp:root></programlisting>
</example>
@@ -1646,33 +1560,34 @@
<para> The <literal>win.jspx</literal> page is predictable:
</para>
<example>
<title></title>
- <programlisting role="JSP"><![CDATA[<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
+ <programlisting role="JSP">
+<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns="http://www.w3.org/1999/xhtml"
version="2.0">
- <jsp:output doctype-root-element="html"
+ <jsp:output doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional...
- <jsp:directive.page contentType="text/html"/>
- <html>
- <head>
- <title>You won!</title>
- <link href="niceforms.css" rel="stylesheet"
type="text/css" />
- </head>
- <body>
- <h1>You won!</h1>
- <f:view>
- Yes, the answer was <h:outputText value="#{numberGuess.currentGuess}"
/>.
- It took you <h:outputText value="#{numberGuess.guessCount}" />
guesses.
- <h:outputText value="But you cheated, so it doesn't count!"
+ <jsp:directive.page contentType="text/html"/>
+ <html>
+ <head>
+ <title>You won!</title>
+ <link href="niceforms.css" rel="stylesheet"
type="text/css" />
+ </head>
+ <body>
+ <h1>You won!</h1>
+ <f:view>
+ Yes, the answer was <h:outputText value="#{numberGuess.currentGuess}"
/>.
+ It took you <h:outputText value="#{numberGuess.guessCount}" />
guesses.
+ <h:outputText value="But you cheated, so it doesn't count!"
rendered="#{numberGuess.cheat}"/>
- Would you like to <a href="numberGuess.seam">play again</a>?
- </f:view>
- </body>
- </html>
-</jsp:root>
-]]></programlisting>
+ Would you like to <a href="numberGuess.seam">play
again</a>?
+ </f:view>
+ </body>
+ </html>
+ </jsp:root>
+</programlisting>
</example>
@@ -1685,7 +1600,8 @@
<areaspec>
<area id="numberguess-create"
coords="13"/>
</areaspec>
- <programlisting><![CDATA[@Name("numberGuess")
+ <programlisting>
+@Name("numberGuess")
@Scope(ScopeType.CONVERSATION)
public class NumberGuess implements Serializable {
@@ -1722,7 +1638,7 @@
{
biggest = currentGuess - 1;
}
- if (currentGuess<randomNumber)
+ if (currentGuess<randomNumber)
{
smallest = currentGuess + 1;
}
@@ -1779,15 +1695,14 @@
return cheated;
}
- public List<Integer> getPossibilities()
+ public List<Integer> getPossibilities()
{
- List<Integer> result = new ArrayList<Integer>();
- for(int i=smallest; i<=biggest; i++) result.add(i);
+ List<Integer> result = new ArrayList<Integer>();
+ for(int i=smallest; i<=biggest; i++) result.add(i);
return result;
}
-}
-]]></programlisting>
+}</programlisting>
<calloutlist>
<callout arearefs="numberguess-create">
<para> The first time a JSP page asks for a
<literal>numberGuess</literal> component, Seam
@@ -1806,21 +1721,22 @@
</para>
- <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
-<pages
xmlns="http://jboss.com/products/seam/pages"
+ <programlisting role="XML">
+<?xml version="1.0" encoding="UTF-8"?>
+<pages
xmlns="http://jboss.com/products/seam/pages"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://jboss.com/products/seam/pages
http://jboss.com/products/seam/pages-2.1.xsd">
+
xsi:schemaLocation="http://jboss.com/products/seam/pages
http://jboss.com/products/seam/pages-2.1.xsd">
- <page view-id="/numberGuess.jspx">
- <begin-conversation join="true" pageflow="numberGuess"/>
- </page>
+<page view-id="/numberGuess.jspx">
+ <begin-conversation join="true"
pageflow="numberGuess"/>
+</page>
- <page view-id="/confirm.jspx">
- <begin-conversation nested="true" pageflow="cheat"/>
- </page>
+<page view-id="/confirm.jspx">
+ <begin-conversation nested="true" pageflow="cheat"/>
+</page>
-</pages>
-]]></programlisting>
+</pages>
+</programlisting>
<para> As you can see, this Seam component is pure business logic!
It doesn't need to know anything at all
@@ -2010,14 +1926,8 @@
<example>
<title></title>
<!-- Can't use code hightlighting with callouts -->
- <programlistingco>
- <areaspec>
- <area id="booking-stateful-annotation"
coords="1"/>
- <area id="booking-restrict-annotation"
coords="4"/>
- <area id="booking-datamodel-annotation"
coords="15"/>
- <area id="booking-destroy-annotation"
coords="70"/>
- </areaspec>
- <programlisting><![CDATA[@Stateful
+ <programlisting>
+@Stateful
@Name("hotelSearch")
@Scope(ScopeType.SESSION)
@Restrict("#{identity.loggedIn}")
@@ -2032,7 +1942,7 @@
private int page;
@DataModel
- private List<Hotel> hotels;
+ private List<Hotel> hotels;
public void find()
{
@@ -2059,7 +1969,7 @@
public boolean isNextPageAvailable()
{
- return hotels!=null && hotels.size()==pageSize;
+ return hotels!=null && hotels.size()==pageSize;
}
public int getPageSize() {
@@ -2089,36 +1999,29 @@
@Remove
public void destroy() {}
-}]]></programlisting>
- <calloutlist>
- <callout arearefs="booking-stateful-annotation">
+} </programlisting>
+
<para> The EJB standard
<literal>@Stateful</literal> annotation identifies this class as a
stateful session bean. Stateful session beans are scoped
to the conversation context by
default. </para>
- </callout>
- <callout arearefs="booking-restrict-annotation">
+
<para> The <literal>@Restrict</literal>
annotation applies a security restriction to the
component. It restricts access to the component allowing
only logged-in users. The
security chapter explains more about security in Seam.
</para>
- </callout>
- <callout
arearefs="booking-datamodel-annotation">
- <para> The <link
linkend="datamodel-annotation">
+
+ <para> The
<literal>@DataModel</literal>
- </link> annotation exposes a
<literal>List</literal> as a JSF
+ annotation exposes a <literal>List</literal>
as a JSF
<literal>ListDataModel</literal>. This makes
it easy to implement clickable lists for
search screens. In this case, the list of hotels is
exposed to the page as a
<literal>ListDataModel</literal> in the
conversation variable named
<literal>hotels</literal>. </para>
- </callout>
- <callout arearefs="booking-destroy-annotation">
+
<para> The EJB standard
<literal>@Remove</literal> annotation specifies that a stateful
session bean should be removed and its state destroyed
after invocation of the annotated
method. In Seam, all stateful session beans must define a
method with no parameters marked
<literal>@Remove</literal>. This method
will be
called when Seam destroys the session
context.</para>
- </callout>
- </calloutlist>
- </programlistingco>
</example>
@@ -2127,98 +2030,89 @@
<example>
<title></title>
<!-- Can't use code hightlighting with callouts -->
- <programlistingco>
- <areaspec>
- <area id="booking-support-element"
coords="14"/>
- <area id="booking-status-element"
coords="20"/>
- <area id="booking-outputpanel-element"
coords="37"/>
- <area id="booking-link-element"
coords="61"/>
- </areaspec>
- <programlisting><![CDATA[<div class="section">
+ <programlisting>
+<div class="section">
- <span class="errors">
- <h:messages globalOnly="true"/>
- </span>
+<span class="errors">
+ <h:messages globalOnly="true"/>
+</span>
- <h1>Search Hotels</h1>
+<h1>Search Hotels</h1>
- <h:form id="searchCriteria">
- <fieldset>
- <h:inputText id="searchString"
value="#{hotelSearch.searchString}"
- style="width: 165px;">
- <a:support event="onkeyup"
actionListener="#{hotelSearch.find}"
- reRender="searchResults" />
- </h:inputText>
+<h:form id="searchCriteria">
+<fieldset>
+ <h:inputText id="searchString"
value="#{hotelSearch.searchString}"
+ style="width: 165px;">
+ <a:support event="onkeyup"
actionListener="#{hotelSearch.find}"
+ reRender="searchResults" />
+ </h:inputText>
 
- <a:commandButton id="findHotels" value="Find Hotels"
action="#{hotelSearch.find}"
- reRender="searchResults"/>
+ <a:commandButton id="findHotels" value="Find Hotels"
action="#{hotelSearch.find}"
+ reRender="searchResults"/>
 
- <a:status>
- <f:facet name="start">
- <h:graphicImage value="/img/spinner.gif"/>
- </f:facet>
- </a:status>
- <br/>
- <h:outputLabel for="pageSize">Maximum
results:</h:outputLabel> 
- <h:selectOneMenu value="#{hotelSearch.pageSize}"
id="pageSize">
- <f:selectItem itemLabel="5" itemValue="5"/>
- <f:selectItem itemLabel="10" itemValue="10"/>
- <f:selectItem itemLabel="20" itemValue="20"/>
- </h:selectOneMenu>
- </fieldset>
- </h:form>
+ <a:status>
+ <f:facet name="start">
+ <h:graphicImage value="/img/spinner.gif"/>
+ </f:facet>
+ </a:status>
+ <br/>
+ <h:outputLabel for="pageSize">Maximum
results:</h:outputLabel> 
+ <h:selectOneMenu value="#{hotelSearch.pageSize}"
id="pageSize">
+ <f:selectItem itemLabel="5" itemValue="5"/>
+ <f:selectItem itemLabel="10" itemValue="10"/>
+ <f:selectItem itemLabel="20" itemValue="20"/>
+ </h:selectOneMenu>
+ </fieldset>
+ </h:form>
-</div>
+ </div>
-<a:outputPanel id="searchResults">
- <div class="section">
- <h:outputText value="No Hotels Found"
- rendered="#{hotels != null and hotels.rowCount==0}"/>
- <h:dataTable id="hotels" value="#{hotels}" var="hot"
- rendered="#{hotels.rowCount>0}">
- <h:column>
- <f:facet name="header">Name</f:facet>
+ <a:outputPanel id="searchResults">
+ <div class="section">
+ <h:outputText value="No Hotels Found"
+ rendered="#{hotels != null and hotels.rowCount==0}"/>
+ <h:dataTable id="hotels" value="#{hotels}"
var="hot"
+ rendered="#{hotels.rowCount>0}">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
#{hot.name}
- </h:column>
- <h:column>
- <f:facet name="header">Address</f:facet>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Address</f:facet>
#{hot.address}
- </h:column>
- <h:column>
- <f:facet name="header">City, State</f:facet>
+ </h:column>
+ <h:column>
+ <f:facet name="header">City, State</f:facet>
#{hot.city}, #{hot.state}, #{hot.country}
- </h:column>
- <h:column>
- <f:facet name="header">Zip</f:facet>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Zip</f:facet>
#{hot.zip}
- </h:column>
- <h:column>
- <f:facet name="header">Action</f:facet>
- <s:link id="viewHotel" value="View Hotel"
- action="#{hotelBooking.selectHotel(hot)}"/>
- </h:column>
- </h:dataTable>
- <s:link value="More results" action="#{hotelSearch.nextPage}"
- rendered="#{hotelSearch.nextPageAvailable}"/>
- </div>
-</a:outputPanel> ]]></programlisting>
- <calloutlist>
- <callout arearefs="booking-support-element">
+ </h:column>
+ <h:column>
+ <f:facet name="header">Action</f:facet>
+ <s:link id="viewHotel" value="View Hotel"
+ action="#{hotelBooking.selectHotel(hot)}"/>
+ </h:column>
+ </h:dataTable>
+ <s:link value="More results" action="#{hotelSearch.nextPage}"
+ rendered="#{hotelSearch.nextPageAvailable}"/>
+ </div>
+</a:outputPanel>
+</programlisting>
+
<para> The RichFaces Ajax
<literal><a:support></literal> tag allows a JSF action
event listener to be called by asynchronous
<literal>XMLHttpRequest</literal> when a
JavaScript event like
<literal>onkeyup</literal> occurs. Even better, the
<literal>reRender</literal> attribute
lets us render a fragment of the JSF page and
perform a partial page update when the asynchronous
response is received. </para>
- </callout>
- <callout arearefs="booking-status-element">
+
<para> The RichFaces Ajax
<literal><a:status></literal> tag lets us display a cheesy
annimated image while we wait for asynchronous requests
to return. </para>
- </callout>
- <callout arearefs="booking-outputpanel-element">
+
<para> The RichFaces Ajax
<literal><a:outputPanel></literal> tag defines a region of
the page which can be re-rendered by an asynchronous
request. </para>
- </callout>
- <callout arearefs="booking-link-element">
+
<para> The Seam
<literal><s:link></literal> tag lets us attach a JSF action
listener to an ordinary (non-JavaScript) HTML link. The
advantage of this over the
standard JSF
<literal><h:commandLink></literal> is that it preserves the
@@ -2228,10 +2122,8 @@
EL that lets you use parameters on any method binding
expression. </para>
<para> If you're wondering how navigation occurs,
you can find all the rules in
<literal>WEB-INF/pages.xml</literal>;
- this is discussed in <xref
linkend="events.pageaction.navigation"/>. </para>
- </callout>
- </calloutlist>
- </programlistingco>
+ this is discussed in the navigation section of this book.
</para>
+
</example>
@@ -2247,15 +2139,8 @@
<example>
<title></title>
<!-- Can't use code hightlighting with callouts -->
- <programlistingco>
- <areaspec>
- <area
id="booking-extendedpersistencecontext-annotation" coords="7"/>
- <area id="booking-out-annotation"
coords="17"/>
- <area id="booking-begin-annotation"
coords="31"/>
- <area id="booking-end-annotation"
coords="72"/>
- <area id="booking-dest-annotation"
coords="85"/>
- </areaspec>
- <programlisting><![CDATA[@Stateful
+ <programlisting>
+@Stateful
@Name("hotelBooking")
@Restrict("#{identity.loggedIn}")
public class HotelBookingAction implements HotelBooking
@@ -2341,43 +2226,35 @@
@Remove
public void destroy() {}
-]]></programlisting>
- <calloutlist>
- <callout
arearefs="booking-extendedpersistencecontext-annotation">
+</programlisting>
+
<para> This bean uses an EJB3 <emphasis>extended
persistence context</emphasis>, so that any
entity instances remain managed for the whole lifecycle
of the stateful session bean.
</para>
- </callout>
- <callout arearefs="booking-out-annotation">
- <para> The <link
linkend="out-annotation">
+
+ <para> The
<literal>@Out</literal>
- </link> annotation declares that an attribute value
is <emphasis>outjected</emphasis> to
+ annotation declares that an attribute value is
<emphasis>outjected</emphasis> to
a context variable after method invocations. In this
case, the context variable named
<literal>hotel</literal> will be set to
the value of the <literal>hotel</literal>
instance variable after every action listener invocation
completes. </para>
- </callout>
- <callout arearefs="booking-begin-annotation">
- <para> The <link
linkend="begin-annotation">
+
+ <para> The
<literal>@Begin</literal>
- </link> annotation specifies that the annotated
method begins a <emphasis>long-running
+ annotation specifies that the annotated method begins a
<emphasis>long-running
conversation</emphasis>, so the current
conversation context will not be destroyed
at the end of the request. Instead, it will be
reassociated with every request from the
current window, and destroyed either by timeout due to
conversation inactivity or
invocation of a matching
<literal>@End</literal> method. </para>
- </callout>
- <callout arearefs="booking-end-annotation">
- <para> The <link
linkend="end-annotation">
+
+ <para> The
<literal>@End</literal>
- </link> annotation specifies that the annotated
method ends the current long-running
+ annotation specifies that the annotated method ends the
current long-running
conversation, so the current conversation context will be
destroyed at the end of the
request. </para>
- </callout>
- <callout arearefs="booking-dest-annotation">
+
<para> This EJB remove method will be called when Seam
destroys the conversation context.
Don't forget to define this method! </para>
- </callout>
- </calloutlist>
- </programlistingco>
</example>
@@ -2404,7 +2281,9 @@
<literal><s:link></literal> control for
navigation from the search screen to the hotel
page: </para>
- <programlisting role="JAVA"><![CDATA[<s:link
value="View Hotel"
action="#{hotelBooking.selectHotel(hot)}"/>]]></programlisting>
+ <programlisting role="JAVA">
+<s:link value="View Hotel"
action="#{hotelBooking.selectHotel(hot)}"/>
+</programlisting>
<para> The use of <literal><s:link></literal>
here allows us to attach an action listener to a
HTML link without breaking the browser's "open in new
window" feature. The standard JSF
@@ -2426,7 +2305,9 @@
<literal>WEB-INF/lib</literal>, along with the Facelets,
and if you set the debug property
of the <literal>init</literal> component:</para>
- <programlisting role="XML"><![CDATA[<core:init
jndi-pattern="@jndiPattern@"
debug="true"/>]]></programlisting>
+<programlisting role="XML">
+<core:init jndi-pattern="@jndiPattern@" debug="true"/>
+</programlisting>
<para> This page lets you browse and inspect the Seam components
in any of the Seam contexts associated with your current login session.
Just point your browser at
@@ -2529,34 +2410,36 @@
entries: </para>
<example>
<title></title>
- <programlisting role="XHTML"><![CDATA[<h:dataTable
value="#{blog.recentBlogEntries}" var="blogEntry"
rows="3">
- <h:column>
- <div class="blogEntry">
- <h3>#{blogEntry.title}</h3>
- <div>
- <h:outputText escape="false"
- value="#{blogEntry.excerpt==null ? blogEntry.body :
blogEntry.excerpt}"/>
- </div>
- <p>
- <h:outputLink value="entry.seam"
rendered="#{blogEntry.excerpt!=null}">
- <f:param name="blogEntryId"
value="#{blogEntry.id}"/>
+ <programlisting role="XHTML">
+<h:dataTable value="#{blog.recentBlogEntries}" var="blogEntry"
rows="3">
+<h:column>
+<div class="blogEntry">
+<h3>#{blogEntry.title}</h3>
+<div>
+ <h:outputText escape="false"
+ value="#{blogEntry.excerpt==null ? blogEntry.body :
blogEntry.excerpt}"/>
+</div>
+<p>
+ <h:outputLink value="entry.seam"
rendered="#{blogEntry.excerpt!=null}">
+ <f:param name="blogEntryId"
value="#{blogEntry.id}"/>
Read more...
- </h:outputLink>
- </p>
- <p>
- [Posted on
- <h:outputText value="#{blogEntry.date}">
- <f:convertDateTime timeZone="#{blog.timeZone}"
- locale="#{blog.locale}"
type="both"/>
- </h:outputText>]
+ </h:outputLink>
+</p>
+<p>
+[Posted on
+<h:outputText value="#{blogEntry.date}">
+ <f:convertDateTime timeZone="#{blog.timeZone}"
+ locale="#{blog.locale}" type="both"/>
+</h:outputText>]
 
- <h:outputLink value="entry.seam">[Link]
- <f:param name="blogEntryId"
value="#{blogEntry.id}"/>
- </h:outputLink>
- </p>
- </div>
- </h:column>
-</h:dataTable>]]></programlisting>
+<h:outputLink value="entry.seam">[Link]
+ <f:param name="blogEntryId" value="#{blogEntry.id}"/>
+</h:outputLink>
+</p>
+</div>
+</h:column>
+</h:dataTable>
+</programlisting>
</example>
@@ -2568,12 +2451,8 @@
<example>
<title></title>
<!-- Can't use code hightlighting with callouts -->
- <programlistingco>
- <areaspec>
- <area id="blog-seampc" coords="7"/>
- <area id="blog-unwrap" coords="9"/>
- </areaspec>
- <programlisting><![CDATA[@Name("blog")
+ <programlisting>
+@Name("blog")
@Scope(ScopeType.STATELESS)
@AutoCreate
public class BlogService
@@ -2589,23 +2468,19 @@
.getSingleResult();
}
-}]]></programlisting>
- <calloutlist>
- <callout arearefs="blog-seampc">
+</programlisting>
+
<para> This component uses a
<emphasis>seam-managed persistence context</emphasis>. Unlike
the other examples we've seen, this persistence
context is managed by Seam, instead of
by the EJB3 container. The persistence context spans the
entire web request, allowing us
to avoid any exceptions that occur when accessing
unfetched associations in the view.
</para>
- </callout>
- <callout arearefs="blog-unwrap">
+
<para> The <literal>@Unwrap</literal>
annotation tells Seam to provide the return value of
the method—the
<literal>Blog</literal>—instead of the actual
<literal>BlogService</literal> component
to clients. This is the Seam
<emphasis>manager component
pattern</emphasis>. </para>
- </callout>
- </calloutlist>
- </programlistingco>
+
</example>
@@ -2622,12 +2497,13 @@
template, <literal>template.xhtml</literal>: </para>
<example>
<title></title>
- <programlisting role="XHTML"><![CDATA[<div
id="search">
- <h:form>
- <h:inputText value="#{searchAction.searchPattern}"/>
- <h:commandButton value="Search" action="/search.xhtml"/>
- </h:form>
-</div>]]></programlisting>
+ <programlisting role="XHTML">
+<div id="search">
+ <h:form>
+ <h:inputText value="#{searchAction.searchPattern}"/>
+ <h:commandButton value="Search"
action="/search.xhtml"/>
+ </h:form>
+</div></programlisting>
<para> To implement a bookmarkable search results page, we need to
perform a browser redirect after
@@ -2635,23 +2511,27 @@
automatically redirects to the view id when the form is submitted.
Alternatively, we could have defined
a navigation rule like this: </para>
- <programlisting role="XML"><![CDATA[<navigation-rule>
- <navigation-case>
- <from-outcome>searchResults</from-outcome>
- <to-view-id>/search.xhtml</to-view-id>
- <redirect/>
- </navigation-case>
-</navigation-rule>]]></programlisting>
+ <programlisting role="XML">
+<navigation-rule>
+ <navigation-case>
+ <from-outcome>searchResults</from-outcome>
+ <to-view-id>/search.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+</navigation-rule>
+</programlisting>
</example>
<para> Then the form would have looked like this: </para>
- <programlisting role="XHTML"><![CDATA[<div
id="search">
- <h:form>
- <h:inputText value="#{searchAction.searchPattern}"/>
- <h:commandButton value="Search" action="searchResults"/>
- </h:form>
-</div>]]></programlisting>
+ <programlisting role="XHTML">
+<div id="search">
+ <h:form>
+ <h:inputText value="#{searchAction.searchPattern}"/>
+ <h:commandButton value="Search"
action="searchResults"/>
+ </h:form>
+</div>
+</programlisting>
<para> But when we redirect, we need to include the values submitted
with the form as request parameters, to
@@ -2661,12 +2541,13 @@
<literal>WEB-INF/pages.xml</literal>: </para>
<example>
<title></title>
- <programlisting role="XML"><![CDATA[<pages>
- <page view-id="/search.xhtml">
- <param name="searchPattern"
value="#{searchService.searchPattern}"/>
- </page>
- ...
-</pages>]]></programlisting>
+ <programlisting role="XML">
+<pages>
+ <page view-id="/search.xhtml">
+ <param name="searchPattern"
value="#{searchService.searchPattern}"/>
+ </page>
+</pages>
+</programlisting>
</example>
@@ -2676,25 +2557,28 @@
<para> The redirect takes us to the
<literal>search.xhtml</literal> page: </para>
- <programlisting role="XHTML"><![CDATA[<h:dataTable
value="#{searchResults}" var="blogEntry">
- <h:column>
- <div>
- <h:outputLink value="entry.seam">
- <f:param name="blogEntryId"
value="#{blogEntry.id}"/>
+ <programlisting role="XHTML">
+<h:dataTable value="#{searchResults}" var="blogEntry">
+ <h:column>
+ <div>
+ <h:outputLink value="entry.seam">
+ <f:param name="blogEntryId"
value="#{blogEntry.id}"/>
#{blogEntry.title}
- </h:outputLink>
+ </h:outputLink>
posted on
- <h:outputText value="#{blogEntry.date}">
- <f:convertDateTime timeZone="#{blog.timeZone}"
locale="#{blog.locale}" type="both"/>
- </h:outputText>
- </div>
- </h:column>
-</h:dataTable>]]></programlisting>
+ <h:outputText value="#{blogEntry.date}">
+ <f:convertDateTime timeZone="#{blog.timeZone}"
locale="#{blog.locale}" type="both"/>
+ </h:outputText>
+ </div>
+ </h:column>
+</h:dataTable>
+</programlisting>
<para> Which again uses "pull"-style MVC to retrieve the
actual search results: </para>
- <programlisting
role="JAVA"><![CDATA[@Name("searchService")
+ <programlisting role="JAVA">
+@Name("searchService")
public class SearchService
{
@@ -2704,7 +2588,7 @@
private String searchPattern;
@Factory("searchResults")
- public List<BlogEntry> getSearchResults()
+ public List<BlogEntry> getSearchResults()
{
if (searchPattern==null)
{
@@ -2737,7 +2621,7 @@
this.searchPattern = searchPattern;
}
-}]]></programlisting>
+}</programlisting>
</section>
@@ -2753,7 +2637,8 @@
<para> The <literal>entryAction</literal> component works
much like an action class in a traditional
push-MVC action-oriented framework like Struts: </para>
- <programlisting
role="JAVA"><![CDATA[@Name("entryAction")
+ <programlisting role="JAVA">
+@Name("entryAction")
@Scope(STATELESS)
public class EntryAction
{
@@ -2769,23 +2654,20 @@
if (blogEntry==null) throw new EntryNotFoundException(id);
}
-}]]></programlisting>
+}</programlisting>
<para> Page actions are also declared in
<literal>pages.xml</literal>: </para>
- <programlisting role="XML"><![CDATA[<pages>
- ...
-
- <page view-id="/entry.xhtml"
action="#{entryAction.loadBlogEntry(blogEntry.id)}">
- <param name="blogEntryId" value="#{blogEntry.id}"/>
- </page>
-
- <page view-id="/post.xhtml"
action="#{loginAction.challenge}"/>
-
- <page view-id="*" action="#{blog.hitCount.hit}"/>
-
-</pages>]]></programlisting>
+ <programlisting role="XML">
+<pages>
+ <page view-id="/entry.xhtml"
action="#{entryAction.loadBlogEntry(blogEntry.id)}">
+ <param name="blogEntryId" value="#{blogEntry.id}"/>
+ </page>
+ <page view-id="/post.xhtml"
action="#{loginAction.challenge}"/>
+ <page view-id="*" action="#{blog.hitCount.hit}"/>
+</pages>
+</programlisting>
<para> Notice that the example is using page actions for some other
functionality—the login
@@ -2798,26 +2680,29 @@
data—the <literal>blogEntry</literal>—and
places it in the Seam event context.
Finally, the following is rendered: </para>
- <programlisting role="XHTML"><![CDATA[<div
class="blogEntry">
- <h3>#{blogEntry.title}</h3>
- <div>
- <h:outputText escape="false" value="#{blogEntry.body}"/>
- </div>
- <p>
+ <programlisting role="XHTML">
+<div class="blogEntry">
+<h3>#{blogEntry.title}</h3>
+<div>
+ <h:outputText escape="false"
value="#{blogEntry.body}"/>
+</div>
+<p>
[Posted on 
- <h:outputText value="#{blogEntry.date}">
- <f:convertDateTime timezone="#{blog.timeZone}"
- locale="#{blog.locale}" type="both"/>
- </h:outputText>]
- </p>
-</div>]]></programlisting>
+ <h:outputText value="#{blogEntry.date}">
+ <f:convertDateTime timezone="#{blog.timeZone}"
+ locale="#{blog.locale}" type="both"/>
+ </h:outputText>]
+</p>
+</div>
+</programlisting>
<para> If the blog entry is not found in the database, the
<literal>EntryNotFoundException</literal>
exception is thrown. We want this exception to result in a 404 error, not
a 505, so we annotate the
exception class: </para>
- <programlisting
role="JAVA"><![CDATA[@ApplicationException(rollback=true)
+ <programlisting role="JAVA">
+@ApplicationException(rollback=true)
@HttpError(errorCode=HttpServletResponse.SC_NOT_FOUND)
public class EntryNotFoundException extends Exception
{
@@ -2825,12 +2710,13 @@
{
super("entry not found: " + id);
}
-}]]></programlisting>
+}</programlisting>
<para> An alternative implementation of the example does not use the
parameter in the method binding: </para>
- <programlisting
role="JAVA"><![CDATA[@Name("entryAction")
+ <programlisting role="JAVA">
+@Name("entryAction")
@Scope(STATELESS)
public class EntryAction
{
@@ -2846,17 +2732,15 @@
if (blogEntry==null) throw new EntryNotFoundException(id);
}
-}]]></programlisting>
+}</programlisting>
- <programlisting role="XML"><![CDATA[<pages>
- ...
-
- <page view-id="/entry.xhtml"
action="#{entryAction.loadBlogEntry}">
- <param name="blogEntryId" value="#{blogEntry.id}"/>
- </page>
-
- ...
-</pages>]]></programlisting>
+ <programlisting role="XML">
+<pages>
+ <page view-id="/entry.xhtml"
action="#{entryAction.loadBlogEntry}">
+ <param name="blogEntryId" value="#{blogEntry.id}"/>
+ </page>
+</pages>
+</programlisting>
<para> It is a matter of taste which implementation you prefer.
</para>