Author: atsebro
Date: 2008-10-23 09:40:39 -0400 (Thu, 23 Oct 2008)
New Revision: 10881
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml
Log:
RF-4056: Getting Started with RichFaces chapter should be updated
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml 2008-10-23
13:33:13 UTC (rev 10880)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml 2008-10-23
13:40:39 UTC (rev 10881)
@@ -13,52 +13,58 @@
</chapterinfo>
<title>Getting Started with RichFaces</title>
<para>This chapter describes all necessary actions and configurations
that should be done
- for adding the RichFaces library into a JSF project. The description
relies on a
- simple JSF application creation process from downloading the
libraries to
- running the application in a browser.</para>
+ for plugging the RichFaces components into a JSF appplication. The
description
+ relies on a simple JSF with RichFaces application creation process
from
+ downloading the libraries to running the application in a browser.
The process
+ of application creation described here is common and does not depends
on used
+ IDE. </para>
+ <para>See "<ulink
+
url="http://docs.jboss.org/tools/movies/demos/rich_faces_demo/rich_f...
+ > RichFaces Toolkit for developing Web
application</ulink>"
+ video tutorial for benefits that gives the JBoss Developer Studio for
developing
+ applications using RichFaces. </para>
+
<section id="DownloadingRichFaces">
<?dbhtml filename="DownloadingRichFaces.html" ?>
<title>Downloading the RichFaces</title>
-
- <para> The latest release of RichFaces components is available
for download at
+ <para>The latest release of RichFaces components is available
for download at
<ulink
url="http://labs.jboss.com/jbossrichfaces/downloads"
JBoss RichFaces Downloads area</ulink> at JBoss community.
- Files that uploaded there have different extensions,
which should be
- touched here: <code>*.bin.zip</code> archives
contain full compiled
- version of components for Windows and Mac operating systems
and
- <code>*.src.zip</code> archives have
it source code;
- <code>*.bin.tar.gz</code> and
<code>*.src.tar.gz</code>
- archives contain compiled version and source code for
UNIX-like
- systems correspondingly; uploaded there
<code>*.jar</code> files
- contain components skins. </para>
- <para> In computer file system create new folder; download and
unzip the archive
- with components there. </para>
+ Binary files (uploaded there in
<code>*.bin.zip</code> or
+ <code>*.bin.tar.gz</code> archives)
contains compiled,
+ ready-to-use version of RichFaces with set of basic skins.
</para>
+ <para>To start with RichFaces in computer file system create
new folder with
+ name "RichFaces", download and unzip the archive
with binaries there.
+ </para>
</section>
- <section id="Creating a simple application with RichFaces">
+ <section id="Simple JSF application with RichFaces">
<?dbhtml filename="Installation.html" ?>
- <title>Creating a simple application with
RichFaces</title>
+ <title>Simple JSF application with RichFaces</title>
<para> "RichFaces Greeter"—the simple application—is
hello-world like
application but with one difference: the world of RichFaces
will say
- "Hello!" to user first. </para>
- <para> Create new JSF 1.2 project with name
"Greeter", JSFBlankWithLibs template
- and Servlet version 2.5. </para>
- <para> To import RichFaces libraries into the project in the
JBoss Developer
- studio click with RMB on the project name in the
"Package Explorer"
- window and select "Build Path"—›"Configure
Build Path…" in context
- menu. In opened "Java Build Path" window click
"Add external JARs…"
- button in "Libraries" tab. Pass to the folder
with unzipped earlier
- RichFaces components and open <code>lib</code>
folder. This folder contains three
- <code>*.jar</code> files with API, UI
and implementation
- libraries. Select all of them and add to project libraries.
Another
- way to import RichFaces libraries into the project is to
copy in
- computer file system that "jars" from
<code>lib</code> folder to
- <code>WEB-INF/lib</code> folder of
the application. </para>
- <para> After RichFaces libraries where added into the project
libraries it is
- necessary to register them in project
<code>web.xml</code> file. Add following in
- <code>web.xml</code>: </para>
- <programlisting role="XML"><![CDATA[...
+ "Hello!" to user first.
+ </para>
+ <para> Create standard JSF 1.2 project with all necessary
libraries; name the project
+ "Greeter" and follow the decription. </para>
+
+ <section id="Adding RichFaces libraries into the
project">
+ <title>Adding RichFaces libraries into the
project</title>
+ <para>Pass to the folder with unzipped earlier
RichFaces binary files
+ and open <code>lib</code> folder.
This folder contains three
+ <code>*.jar</code> files
with API, UI and
+ implementation libraries. Copy that
"jars" from
+ <code>lib</code> folder to
<code>WEB-INF/lib</code> folder
+ of "Greeter" JSF application.
</para>
+ </section>
+
+ <section id="Registering RichFaces in web.xml">
+ <title>Registering RichFaces in
web.xml</title>
+ <para> After RichFaces libraries where added into the
project it is
+ necessary to register them in project
<code>web.xml</code>
+ file. Add following lines in
<code>web.xml</code>: </para>
+ <programlisting role="XML"><![CDATA[...
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
@@ -78,20 +84,12 @@
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
...]]></programlisting>
- <para> To enable standard control skinning following lines
should be added into
- <code>web.xml</code> too:
</para>
- <programlisting role="XML"><![CDATA[...
-<context-param>
- <param-name>org.richfaces.CONTROL_SKINNING</param-name>
- <param-value>enable</param-value>
-</context-param>
-...]]></programlisting>
- <para> Finally the <code>web.xml</code> should look
like the following: </para>
- <programlisting role="XML"><![CDATA[<?xml
version="1.0"?>
+ <para>Finally the <code>web.xml</code>
should look like the following: </para>
+ <programlisting
role="XML"><![CDATA[<?xml version="1.0"?>
<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">
+
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">
<display-name>Greeter</display-name>
<context-param>
@@ -103,13 +101,7 @@
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
-
-<!-- Enabling control skinning -->
-<context-param>
- <param-name>org.richfaces.CONTROL_SKINNING</param-name>
- <param-value>enable</param-value>
-</context-param>
-
+
<!-- RichFaces Filter -->
<filter>
<display-name>RichFaces Filter</display-name>
@@ -146,13 +138,17 @@
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
-</web-app>
-...]]></programlisting>
- <para> The "RichFaces Greeter" application need a
managed bean. Create a new
- managed bean with name <code>user</code> in
<code>demo</code> package and paste there the following simple
- code: </para>
- <programlisting role="JAVA">package demo;
+</web-app>]]></programlisting>
+ </section>
+ <section id="Managed bean">
+ <title>Managed bean</title>
+ <para>The "RichFaces Greeter" application
need a managed bean. In
+ project <code>JavaSource</code>
folder create a new managed
+ bean with name <code>user</code> in
<code>demo</code>
+ package and paste there the following simple
code: </para>
+ <programlisting role="JAVA">package demo;
+
public class user {
private String name="";
public String getName() {
@@ -162,13 +158,18 @@
this.name = name;
}
}</programlisting>
- <para> With the next step the "user" bean should be
registered in <code>faces-config.xml</code> file: </para>
- <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
+ </section>
+
+ <section id="Registering bean in faces-cofig.xml">
+ <title>Registering bean in
faces-cofig.xml</title>
+ <para>With the next step the
<code>user</code> bean should be
+ registered in
<code>faces-config.xml</code> file: </para>
+ <programlisting
role="XML"><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>
<faces-config version="1.2"
-
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xi="http://www.w3.org/2001/XInclude"
-
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">
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
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">
<managed-bean>
<description>UsernName Bean</description>
<managed-bean-name>user</managed-bean-name>
@@ -182,10 +183,15 @@
</managed-bean>
</faces-config>
]]></programlisting>
- <para> The "RichFaces Greeter" application has only
one JSP page. Create <code>pages</code>
- folder in root of <code>WEB CONTENT</code>
folder. Create <code>greeter.jsp</code> page
- inside <code>pages</code> and add there
following code: </para>
- <programlisting role="XML"><![CDATA[<!doctype
html public "-//w3c//dtd html 4.0 transitional//en">
+ </section>
+
+ <section id="RichFaces Greeter index.jsp">
+ <title>RichFaces Greeter index.jsp</title>
+ <para> The "RichFaces Greeter" application
has only one JSP page.
+ Create <code>index.jsp</code> page in
root of <code>WEB
+ CONTENT</code> folder and add
there following
+ code: </para>
+ <programlisting
role="XML"><![CDATA[<!doctype html public "-//w3c//dtd html 4.0
transitional//en">
<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
<!-- RichFaces tag library declaration -->
@@ -215,32 +221,34 @@
</h:panelGroup>
</f:view>
</body>
- </html>]]></programlisting>
- <para> The application uses two RichFaces components:
<emphasis role="bold">
-
<property><a4j:commandButton></property>
- </emphasis> with built-in Ajax support allows
rendering a
- greeting dynamically after a response comes back and
<emphasis
- role="bold">
-
<property><a4j:form></property>
- </emphasis> helps the button to perform the action.
</para>
- <para> Note, that the RichFaces tag library should be declared
on each JSP page.
- For XHTML pages add following lines for tag library
declaration: </para>
- <programlisting
role="XML"><![CDATA[<xmlns:a4j="http://richfaces....
+</html>]]></programlisting>
+ <para>The application uses two RichFaces components:
<emphasis
+ role="bold">
+
<property><a4j:commandButton></property>
+ </emphasis> with built-in Ajax support
allows rendering a
+ greeting dynamically after a response comes back
and
+ <emphasis role="bold">
+
<property><a4j:form></property>
+ </emphasis> helps the button to perform the
action. </para>
+ <para>Note, that the RichFaces tag library should be
declared on each
+ JSP page. For XHTML pages add following lines for
tag
+ library declaration: </para>
+ <programlisting
role="XML"><![CDATA[<xmlns:a4j="http://richfaces....
<
xmlns:rich="http://richfaces.org/rich">]]></programlis...
- <para> That’s it. Run the application on server. Write the full
pass to <code>greeter.jsp</code> page in browser;
- do not forget to change the extension to
<code>*.jsf</code>:
<code>http://localhost:8080/Greeter/pages/greeter.jsf</code>
- </para>
- <figure>
- <title>"RichFaces Greeter"
application</title>
- <mediaobject>
- <imageobject>
- <imagedata
fileref="images/RichFaces Greeter.png" />
- </imageobject>
- </mediaobject>
- </figure>
- <para>
- <ulink
url="http://docs.jboss.org/tools/movies/demos/rich_faces_demo/rich_f...
Toolkit for developing Web application</ulink> video tutorial at JBoss portal
- shows how to perform the described actions in JBoss
Developer Studio in details.
- </para>
+ <para>That’s it. Run the application on server. Write
the full pass to
+ <code>index.jsp</code> page
in browser:
+
<code>http://localhost:8080/Greeter/index.jsf</code>
+ </para>
+ <figure>
+ <title>"RichFaces Greeter"
application</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/RichFaces
Greeter.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
</section>
</chapter>