[jboss-cvs] JBossAS SVN: r77198 - projects/docs/enterprise/4.3.2.1/Seam/Seam_Reference_Guide/en-US.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 19 20:18:33 EDT 2008


Author: irooskov at redhat.com
Date: 2008-08-19 20:18:33 -0400 (Tue, 19 Aug 2008)
New Revision: 77198

Modified:
   projects/docs/enterprise/4.3.2.1/Seam/Seam_Reference_Guide/en-US/Tutorial.xml
Log:
fixed tutorial.xml file by removing CDATA tags and marking up the xml correcty


Modified: projects/docs/enterprise/4.3.2.1/Seam/Seam_Reference_Guide/en-US/Tutorial.xml
===================================================================
--- projects/docs/enterprise/4.3.2.1/Seam/Seam_Reference_Guide/en-US/Tutorial.xml	2008-08-19 16:54:56 UTC (rev 77197)
+++ projects/docs/enterprise/4.3.2.1/Seam/Seam_Reference_Guide/en-US/Tutorial.xml	2008-08-20 00:18:33 UTC (rev 77198)
@@ -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>
@@ -204,9 +204,8 @@
                                         <literal>User</literal> class is an entity bean. </para>
 
                                 <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
@@ -215,9 +214,9 @@
 
                                 <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>
 
                                 <para> The EJB standard <literal>@Table</literal> annotation indicates that the
@@ -307,9 +306,9 @@
                                 <para> The EJB standard <literal>@Stateless</literal> annotation marks this class as
                                     a stateless session bean. </para>
 
-                                <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>
                        
@@ -380,7 +379,7 @@
 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>
@@ -1722,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">
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;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"&gt;
 
-  <page view-id="/numberGuess.jspx">
-    <begin-conversation join="true" pageflow="numberGuess"/>
-  </page>
+&lt;page view-id="/numberGuess.jspx"&gt;
+	&lt;begin-conversation join="true" pageflow="numberGuess"/&gt;
+&lt;/page&gt;
 
-  <page view-id="/confirm.jspx">
-    <begin-conversation nested="true" pageflow="cheat"/>
-  </page>
+&lt;page view-id="/confirm.jspx"&gt;
+	&lt;begin-conversation nested="true" pageflow="cheat"/&gt;
+&lt;/page&gt;
 
-</pages>      
-]]></programlisting>                  
+&lt;/pages&gt;      
+</programlisting>                  
             
             
                <para> As you can see, this Seam component is pure business logic! It doesn't need to know anything at all
@@ -1926,13 +1926,6 @@
             <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>
 @Stateful
 @Name("hotelSearch")
@@ -1976,7 +1969,7 @@
    
    public boolean isNextPageAvailable()
    {
-      return hotels!=null && hotels.size()==pageSize;
+      return hotels!=null &amp;&amp; hotels.size()==pageSize;
    }
    
    public int getPageSize() {
@@ -2007,35 +2000,28 @@
    @Remove
    public void destroy() {}
 } </programlisting>
-                    <calloutlist>
-                        <callout arearefs="booking-stateful-annotation">
+                    
                             <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>
             
 
@@ -2044,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>
+&lt;div class="section"&gt;
   
-    <span class="errors">
-       <h:messages globalOnly="true"/>
-    </span>
+&lt;span class="errors"&gt;
+	&lt;h:messages globalOnly="true"/&gt;
+&lt;/span&gt;
     
-    <h1>Search Hotels</h1>
+&lt;h1&gt;Search Hotels&lt;/h1&gt;
 
-	<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>
+&lt;h:form id="searchCriteria"&gt;
+&lt;fieldset&gt; 
+	&lt;h:inputText id="searchString" value="#{hotelSearch.searchString}" 
+			 style="width: 165px;"&gt;
+		&lt;a:support event="onkeyup" actionListener="#{hotelSearch.find}" 
+			 reRender="searchResults" /&gt;
+	&lt;/h:inputText&gt;
        &#160;
-	   <a:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" 
-                        reRender="searchResults"/>
+       &lt;a:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" 
+       reRender="searchResults"/&gt;
        &#160;
-       <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>&#160;
-       <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>
+       &lt;a:status&gt;
+		&lt;f:facet name="start"&gt;
+			 &lt;h:graphicImage value="/img/spinner.gif"/&gt;
+		&lt;/f:facet&gt;
+	&lt;/a:status&gt;
+			 &lt;br/&gt;
+		 &lt;h:outputLabel for="pageSize"&gt;Maximum results:&lt;/h:outputLabel&gt;&#160;
+				 &lt;h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize"&gt;
+		 &lt;f:selectItem itemLabel="5" itemValue="5"/&gt;
+		 &lt;f:selectItem itemLabel="10" itemValue="10"/&gt;
+		 &lt;f:selectItem itemLabel="20" itemValue="20"/&gt;
+		 &lt;/h:selectOneMenu&gt;
+			 &lt;/fieldset&gt;
+			 &lt;/h:form&gt;
     
-</div>
+			 &lt;/div&gt;
 
-<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>
+			 &lt;a:outputPanel id="searchResults"&gt;
+			 &lt;div class="section"&gt;
+			 &lt;h:outputText value="No Hotels Found"
+			 rendered="#{hotels != null and hotels.rowCount==0}"/&gt;
+		 &lt;h:dataTable id="hotels" value="#{hotels}" var="hot" 
+		 rendered="#{hotels.rowCount&gt;0}"&gt;
+				 &lt;h:column&gt;
+			 &lt;f:facet name="header"&gt;Name&lt;/f:facet&gt;
             #{hot.name}
-        </h:column>
-        <h:column>
-            <f:facet name="header">Address</f:facet>
+	    &lt;/h:column&gt;
+			 &lt;h:column&gt;
+			 &lt;f:facet name="header">Address&lt;/f:facet&gt;
             #{hot.address}
-        </h:column>
-        <h:column>
-            <f:facet name="header">City, State</f:facet>
+	    &lt;/h:column&gt;
+			 &lt;h:column&gt;
+			 &lt;f:facet name="header"&gt;City, State&lt;/f:facet&gt;
             #{hot.city}, #{hot.state}, #{hot.country}
-        </h:column> 
-        <h:column>
-            <f:facet name="header">Zip</f:facet>
+	    &lt;/h:column&gt;
+			 &lt;h:column&gt;
+			 &lt;f:facet name="header"&gt;Zip&lt;/f:facet&gt;
             #{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">
+	    &lt;/h:column&gt;
+	    &lt;h:column&gt;
+			 &lt;f:facet name="header">Action&lt;/f:facet&gt;
+				 &lt;s:link id="viewHotel" value="View Hotel" 
+				 action="#{hotelBooking.selectHotel(hot)}"/&gt;
+	    &lt;/h:column&gt;
+	&lt;/h:dataTable&gt;
+	&lt;s:link value="More results" action="#{hotelSearch.nextPage}" 
+			 rendered="#{hotelSearch.nextPageAvailable}"/&gt;
+	&lt;/div&gt;
+&lt;/a:outputPanel&gt;
+</programlisting>
+                    
                             <para> The RichFaces Ajax <literal>&lt;a:support&gt;</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>&lt;a:status&gt;</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>&lt;a:outputPanel&gt;</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>&lt;s:link&gt;</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>&lt;h:commandLink&gt;</literal> is that it preserves the
@@ -2145,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>
             
 
@@ -2164,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>
+ at Stateful
 @Name("hotelBooking")
 @Restrict("#{identity.loggedIn}")
 public class HotelBookingAction implements HotelBooking
@@ -2258,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>
             
 
@@ -2321,7 +2281,9 @@
                     <literal>&lt;s:link&gt;</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">
+&lt;s:link value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/&gt;
+</programlisting>
 
             <para> The use of <literal>&lt;s:link&gt;</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
@@ -2343,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">
+&lt;core:init jndi-pattern="@jndiPattern@" debug="true"/&gt;
+</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
@@ -2446,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">
+&lt;h:dataTable value="#{blog.recentBlogEntries}" var="blogEntry" rows="3"&gt;
+&lt;h:column&gt;
+&lt;div class="blogEntry"&gt;
+&lt;h3&gt;#{blogEntry.title}&lt;/h3&gt;
+&lt;div&gt;
+	&lt;h:outputText escape="false" 
+		    value="#{blogEntry.excerpt==null ? blogEntry.body : blogEntry.excerpt}"/&gt;
+&lt;/div&gt;
+&lt;p&gt;
+	&lt;h:outputLink value="entry.seam" rendered="#{blogEntry.excerpt!=null}"&gt;
+		    &lt;f:param name="blogEntryId" value="#{blogEntry.id}"/&gt;
                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>]
+	&lt;/h:outputLink&gt;
+&lt;/p&gt;
+&lt;p&gt;
+[Posted on 
+&lt;h:outputText value="#{blogEntry.date}"&gt;
+	&lt;f:convertDateTime timeZone="#{blog.timeZone}" 
+		    locale="#{blog.locale}" type="both"/&gt;
+&lt;/h:outputText&gt;]
             &#160;
-            <h:outputLink value="entry.seam">[Link]
-               <f:param name="blogEntryId" value="#{blogEntry.id}"/>
-            </h:outputLink>
-         </p>
-      </div>
-   </h:column>
-</h:dataTable>]]></programlisting>
+&lt;h:outputLink value="entry.seam"&gt;[Link]
+	&lt;f:param name="blogEntryId" value="#{blogEntry.id}"/&gt;
+&lt;/h:outputLink&gt;
+&lt;/p&gt;
+&lt;/div&gt;
+&lt;/h:column&gt;
+&lt;/h:dataTable&gt;
+</programlisting>
 </example>
             
 
@@ -2485,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>
+ at Name("blog")
 @Scope(ScopeType.STATELESS)
 @AutoCreate
 public class BlogService 
@@ -2506,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&#8212;the <literal>Blog</literal>&#8212;instead of the actual
                                     <literal>BlogService</literal> component to clients. This is the Seam
                                     <emphasis>manager component pattern</emphasis>. </para>
-                        </callout>
-                    </calloutlist>
-                </programlistingco>
+
                </example>
             
 
@@ -2539,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">
+&lt;div id="search"&gt;
+	&lt;h:form&gt;
+		&lt;h:inputText value="#{searchAction.searchPattern}"/&gt;
+	    	&lt;h:commandButton value="Search" action="/search.xhtml"/&gt;
+	&lt;/h:form&gt;
+&lt;/div&gt;</programlisting>
             
 
             <para> To implement a bookmarkable search results page, we need to perform a browser redirect after
@@ -2552,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">
+&lt;navigation-rule&gt;
+	&lt;navigation-case&gt;
+		&lt;from-outcome>searchResults&lt;/from-outcome&gt;
+		&lt;to-view-id&gt;/search.xhtml&lt;/to-view-id&gt;
+		&lt;redirect/&gt;
+	&lt;/navigation-case&gt;
+&lt;/navigation-rule&gt;
+</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">
+&lt;div id="search"&gt;
+	&lt;h:form&gt;
+		&lt;h:inputText value="#{searchAction.searchPattern}"/&gt;
+		&lt;h:commandButton value="Search" action="searchResults"/&gt;
+	&lt;/h:form&gt;
+&lt;/div&gt;
+</programlisting>
             
 
             <para> But when we redirect, we need to include the values submitted with the form as request parameters, to
@@ -2578,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">
+&lt;pages&gt;
+	&lt;page view-id="/search.xhtml"&gt;
+		&lt;param name="searchPattern" value="#{searchService.searchPattern}"/&gt;
+	&lt;/page&gt;
+&lt;/pages&gt;
+</programlisting>
 </example>
             
 
@@ -2593,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">
+&lt;h:dataTable value="#{searchResults}" var="blogEntry"&gt;
+	&lt;h:column&gt;
+	&lt;div&gt;
+		&lt;h:outputLink value="entry.seam"&gt;
+			&lt;f:param name="blogEntryId" value="#{blogEntry.id}"/&gt;
             #{blogEntry.title}
-         </h:outputLink>
+	   	&lt;/h:outputLink&gt;
          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>
+	 	&lt;h:outputText value="#{blogEntry.date}"&gt;
+			&lt;f:convertDateTime timeZone="#{blog.timeZone}" locale="#{blog.locale}" type="both"/&gt;
+		&lt;/h:outputText&gt;
+	&lt;/div&gt;
+	&lt;/h:column&gt;
+&lt;/h:dataTable&gt;
+</programlisting>
             
 
             <para> Which again uses "pull"-style MVC to retrieve the actual search results: </para>
 
-		    <programlisting role="JAVA"><![CDATA[@Name("searchService")
+		    <programlisting role="JAVA">
+ at Name("searchService")
 public class SearchService 
 {
    
@@ -2621,7 +2588,7 @@
    private String searchPattern;
    
    @Factory("searchResults")
-   public List<BlogEntry> getSearchResults()
+   public List&lt;BlogEntry&gt; getSearchResults()
    {
       if (searchPattern==null)
       {
@@ -2654,7 +2621,7 @@
       this.searchPattern = searchPattern;
    }
 
-}]]></programlisting>
+}</programlisting>
             
 
         </section>
@@ -2670,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">
+ at Name("entryAction")
 @Scope(STATELESS)
 public class EntryAction
 {
@@ -2686,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">
+&lt;pages&gt;
+	&lt;page view-id="/entry.xhtml" action="#{entryAction.loadBlogEntry(blogEntry.id)}"&gt;
+		&lt;param name="blogEntryId" value="#{blogEntry.id}"/&gt;
+	&lt;/page&gt;
+	&lt;page view-id="/post.xhtml" action="#{loginAction.challenge}"/&gt;
+	&lt;page view-id="*" action="#{blog.hitCount.hit}"/&gt;
+&lt;/pages&gt;
+</programlisting>
             
 
             <para> Notice that the example is using page actions for some other functionality&#8212;the login
@@ -2715,26 +2680,29 @@
                 data&#8212;the <literal>blogEntry</literal>&#8212;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">
+&lt;div class="blogEntry"&gt;
+&lt;h3&gt;#{blogEntry.title}&lt;/h3&gt;
+&lt;div&gt;
+	&lt;h:outputText escape="false" value="#{blogEntry.body}"/&gt;
+&lt;/div&gt;
+&lt;p&gt;
       [Posted on&#160;
-      <h:outputText value="#{blogEntry.date}">
-         <f:convertDateTime timezone="#{blog.timeZone}" 
-                            locale="#{blog.locale}" type="both"/>
-      </h:outputText>]
-   </p>
-</div>]]></programlisting>
+	&lt;h:outputText value="#{blogEntry.date}"&gt;
+	&lt;f:convertDateTime timezone="#{blog.timeZone}" 
+	    locale="#{blog.locale}" type="both"/&gt;
+	&lt;/h:outputText&gt;]
+&lt;/p&gt;
+&lt;/div&gt;
+</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">
+ at ApplicationException(rollback=true)
 @HttpError(errorCode=HttpServletResponse.SC_NOT_FOUND)
 public class EntryNotFoundException extends Exception
 {
@@ -2742,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">
+ at Name("entryAction")
 @Scope(STATELESS)
 public class EntryAction
 {
@@ -2763,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">
+&lt;pages&gt;
+	&lt;page view-id="/entry.xhtml" action="#{entryAction.loadBlogEntry}"&gt;
+		&lt;param name="blogEntryId" value="#{blogEntry.id}"/&gt;
+	&lt;/page&gt;
+&lt;/pages&gt;
+</programlisting>
             
 
             <para> It is a matter of taste which implementation you prefer. </para>




More information about the jboss-cvs-commits mailing list