advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Launch Party Registration application
Sidebar 1. Get Started with Shale Starter Templates
Partners & Affiliates
advertisement
advertisement
Rate this item | 0 users have rated this item.
 Print Print
 
Apache Shale Takes JavaServer Faces to the Next Level
Apache Shale, the newest sibling of the Struts framework, leverages JavaServer Faces to enable componentized presentation-tier development. Get started with Shale's Dialog Manager, Validations, and JNDI services. 

advertisement
n its time, Struts was the MVC2 framework Its design elegance, simplicity, and robustness enabled a larger portion of Java developers to embrace Struts for presentation-tier development. But alas, it has been five years since Struts was conceived, and it has started to show signs of age. It has remained a monolithic request-processing engine that is hard to customize and extend, while JSF has established itself as a flexible, scalable event-processing engine. Secondly, Struts has failed to add support for declarative workflows, a consistent validation framework, or emerging technologies such as AJAX. This has led to a diminished role for Struts in new development projects.


However, the Struts development team is not idly standing by while JSF gains ground. Comprised of the best minds in the industry, the Struts team has re-invented itself and begun creating services that can supplement and enrich JSF rather than try to compete with it directly. They want to make a good thing (JSF) better. (If you are not familiar with JSF, read "Introduction to JavaServer Faces" and "Face Up to Web Application Design Using JSF and MyFaces" to get up to speed.)

The result is Apache Shale, a framework that builds on JSF's strengths. (I have no idea why the team chose the name Shale. Merriam-Webster defines it as some sort of fissile rock.) Shale provides componentized services that you can use selectively based on your needs. These services vary from as simple as a backing bean (Shale's View Controller) with a few extra functions to a full-fledged Web page navigation engine (Shale's Dialog Manager).

Shale brings quite a number of features to the JSF lineup—more than any one article can cover, so this article focuses on Shale's dialog manager, validation, and Java Naming and Directory Interface (JNDI) services, just enough to whet your appetite. These services will give you a good grasp of the variety, simplicity, flexibility, and strengths of Apache Shale.

Visit the Shale feature page for full descriptions of the following Shale services:

  • View Controller: Backing bean for JSP with predefined events
  • Validations: Client- and service-side validations
  • JNDI: JSP access to properties in web.xml
  • Dialog Manager: Web wizards (workflows) driven by XML configuration files
  • Application Manager: An application-level controller to intercept all HTTP requests
  • AJAX: A server-side service for AJAX support
  • Spring, Tiles, and Clay framework integration and reusable views
  • Test: Mock objects and base classes for JUnit-based tests

Start with Shale Downloads

Downloading Shale is a little involved because it is still in beta. You need to work with nightly builds (adrenaline fix!) from http://cvs.apache.org/builds/struts/nightly/struts-shale/.

Download the following four files with the latest dates in their names (The names of files will vary based on the day you download them.):

  • shale-framework-YYYYMMDD.{tar.gz,zip} – contains the binary and source of the core Shale framework
  • shale-starter-YYYYMMDD.{tar.gz,zip} – contains a template directory structure for a Shale-based application and Apache Ant as the build tool
  • shale-blank-YYYYMMDD.war – contains sample Shale Web application that shows current date and time
  • shale-dependencies-YYYYMMDD.zip – contains supporting JAR libraries required for Shale-based applications

The following were the latest Shale downloads on March 8, 2006:


shale-framework-20060308.zip
shale-starter-20060308.zip
shale-blank-20060308.war
shale-dependencies-20060308.zip

"Sidebar 1. Get Started with Shale Starter Templates" provides a step-by-step guide for creating your own project from the Shale downloads. I used the same guidelines to create a Web registration application for a fictitious Shale launch party using Shale's dialog manager, JNDI, and validation services. Download this sample application now.

Unzip the download. This will create a 'launch-party' folder that contains 'lib' and 'src' folders, along with Apache Ant build files. The 'src' folder contains Java and JSP source files for the project. The 'lib' folder is empty. Build.xml and default.properties, found under the launch-party folder, are Apache Ant build files. Build.xml has various Ant build tasks that clean and create directories, copy files to build folders, compile and create war files, deploy to Tomcat, etc. I particularly like the 'dist' task, which among a plethora of other files also creates a deployable war file.

Before you jump to executing these Ant tasks, you need to perform the following two steps:

  1. Change the value of 'shale.dir' in launch-party\default.properties to your Shale installation directory.
  2. Copy the extracts of shale-dependencies-YYYYMMDD.zip to the launch-party\lib folder.

Be sure that you meet the software pre-requisites in the What You Need box before you go any further. When you are set, you will be ready to jump head first into Apache Shale Services.

What You Need
  • Apache Ant 1.6.5
  • Apache Tomcat 5.5.15
  • Apache Shale
  • Java Standard Edition JDK 1.4 or higher
  • Java Standard Edition JRE 1.4 or higher
  • (For those you who like to live on the edge, JDK and JRE 1.6-beta will do too.)
  • Page 1 of 4


    advertisement
      Next Page: Wizard Creation with Dialog Manager
    Page 1: IntroductionPage 3: Keep Users in Line with Validations
    Page 2: Wizard Creation with Dialog ManagerPage 4: A Direct Line to JNDI
    advertisement
    Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About


    JupiterOnlineMedia

    internet.comearthweb.comDevx.commediabistro.comGraphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info


    Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

    Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

    Solutions
    Whitepapers and eBooks
    Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
    Avaya Article: How to Feed Data into the Avaya Event Processor
    Microsoft Article: Install What You Need with Win Server ‘08
    HP eBook: Putting the Green into IT
    Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
    Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
    Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
    Avaya Article: Setting Up a SIP A/S Development Environment
    IBM Article: How Cool Is Your Data Center?
    Microsoft Article: Managing Virtual Machines with Microsoft System Center
    HP eBook: Storage Networking , Part 1
    Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
    MORE WHITEPAPERS, EBOOKS, AND ARTICLES
    Webcasts
    Intel Video: Are Multi-core Processors Here to Stay?
    On-Demand Webcast: Five Virtualization Trends to Watch
    HP Video: Page Cost Calculator
    Intel Video: APIs for Parallel Programming
    HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
    Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
    MORE WEBCASTS, PODCASTS, AND VIDEOS
    Downloads and eKits
    Sun Download: Solaris 8 Migration Assistant
    Sybase Download: SQL Anywhere Developer Edition
    Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
    Red Gate Download: SQL Compare Pro 6
    Iron Speed Designer Application Generator
    MORE DOWNLOADS, EKITS, AND FREE TRIALS
    Tutorials and Demos
    How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
    eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
    IBM Article: Collaborating in the High-Performance Workplace
    HP Demo: StorageWorks EVA4400
    Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
    Microsoft How-to Article: Get Going with Silverlight and Windows Live
    MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES