Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Chapter 4. About the Example Applications

In this guide, we make use of a simple web application to illustrate the use of JSF-EJB3 components. We then illustrate how to use Seam to integrate the JSF and EJB3 components. The example applications (source code) come with this guide and you can find them located in the JBOSS_DIST/doc/examples/gettingstarted directory. You can also download the sample applications from https://www.redhat.com/docs/manuals/jboss. We use two examples in this book:
  • A simple "TODO" application to create, view and edit tasks - implemented using JSF and EJB3;
  • The same application using the SEAM framework.
If you installed the documentation on your hard drive, then the first example can be found in the JBOSS_DIST/doc/examples/gettingstarted/jsfejb3 directory. We will see how to build this example using the build.xml file present here and also how to deploy the application. We will also cover in detail the working of the .java, .xml and .properties files.
The second example used in this guide can be found in the JBOSS_DIST/doc/examples/gettingstarted/seamejb3 directory. Using a simple "TODO" application we will illustrate how Seam ties together the database, the web interface and the EJB3 business logic in a web application. We will use the build.xml file present here to compile and build our Seam application.
Within the JBOSS_DIST/doc/examples/gettingstarted/<seamejb3|jsfejb3> directory, you will find the following sub-directories:
  • src : contains the Java source code files.
  • view : contains the web pages.
  • resources : contains all the configuration files used.

4.1. Install Ant

To compile and package the examples, you must have Apache Ant 1.6+ installed in your machine. You can download it from https://ant.apache.org and have it installed in few steps:
  • Unzip the downloaded file to the directory of your choice.
  • Create an environment variable called ANT_HOME pointing to the Ant installation directory. You can do this by adding the following line to your .bashrc file (substituting with the actual location of the ant directory on your system):
    export ANT_HOME=/home/user/apache-ant-1.7.0
    
    On Windows you do this by opening the Control Panel from the Start Menu, switching it to classic view if necessary, then opening System/Advanced/Environment Variables. Create a new variable, call it ANT_HOME and set it to be the ant directory.
  • Add $ANT_HOME/bin to the system path to be able to run ant from the command line. You can do this by adding the following line to your .bashrc file:
    export PATH=$PATH:$ANT_HOME/bin
    
    On Windows you do this by opening the Control Panel from the Start Menu, switching it to classic view if necessary, then editing the PATH environment variable found in System/Advanced/Environment Variables/System Variables/Path. Add a semicolon and the path to the ant bin directory.
  • Verify your Ant installation. To do this type ant -version at the command prompt. Your output should look something like this:
    Apache Ant version 1.7.0 compiled on December 13 2006
    

 
 
  Published under the terms of the Open Publication License Design by Interspire