ArticlesTutorialsInterview Questions & AnswersCertificationsFree Books & Sample ChaptersTechnical Discussions  Your Account | Advertise with us | Feedback |
Few pages of this site are under construction and we are constantly trying to improve it. If you have any suggestions or ideas about how to improve the site, please Let us know.
A first look at Shale Framework - Get started with Shale

A first look at Shale Framework
Get started with Shale    -by Anand ,DevelopersBook.com, 06/02/2007

Introduction

            Over the last few years, a variety of frameworks for building Java-based web applications have been created. Of all the Web frameworks to come out of the past  years, Jakarta Struts is among the most popular ever to be used by developers. However, Java Server Faces has become a standard part of the Java EE 5 platform, providing both a user interface component framework and the basis for a web application framework.

It is possible to integrate Java Server Faces components into many frameworks ,including Struts. However, the resulting architecture leaves you with redundant implementations of many features, such as navigation and validation. A framework that uses JavaServer Faces extension points, on the other hand, would provide a leaner and easier-to-use base for building webapps.

Shale is such a framework, that builds on JSF's strengths.. It leverages JSF extension points to provide additional functionality such as application event callbacks, dialogs with conversation-scoped state, annotation-based functionality to reduce configuration requirements, support for remoting, while leveraging the standard application controller facilities of JSF. This article will introduce the basic features of Shale, and walk you through building a very simple application using Shale and Java Server Faces technology.

Getting Started

Prerequisites

Shale is based on (and requires a runtime environment that supports) the following foundation technologies:

  • Java Runtime Environment (JRE) 1.4 or later.
  • Servlet API 2.4 or later.
  • Java Server Pages 2.0 or later.
  • Java Server Faces 1.1 or later.
  • JSP Standard Tag Library (JSTL) 1.1 or later.
  • Apache Commons BeanUtils 1.7 or later.
  • Apache Commons Chain 1.1 or later.
  • Apache Commons Digester 1.8 or later.
  • Apache Commons Logging 1.1 or later.

Installing Shale

Add Required Libraries

The next thing we'll need to do is download the dependencies for our Shale App. First download our direct dependencies.

If your server does not already provide an implementation of JavaServer Faces, you must include such an implementation (plus all of its dependent JARs) in the /WEB-INF/lib directory.

Most Shale based applications will require shale-core.jar (and its dependencies, as described above). If you wish to utilize the features provided in the optional Shale components, include those JARs (and ther external dependencies) as well.

The shale-test.jar contains base classes for JUnit based unit tests for your application classes. As such, it is useful only at application build time, and should never be included in a runtime web application archive.

The shale-tiger.jar contains feature extensions that depend on platform capabilities (most particularly the annotations facility) of Java SE 5 (code named "Tiger"). You must NOT include this library if you are running on a JDK 1.4 platform.

To download Shale, visit the Shale project home page. You'll find a "Shale Download" section with links to Nightly builds of the Shale framework. Nightly builds of Shale are also available from http://people.apache.org/builds/shale/nightly/. For convenience, the nightly builds include the following packages:

  • Shale-framework-YYYYMMDD.{tar.gz,zip} - The binary and source download of the framework itself, including its dependencies.
  • Shale-XXXXXXXX-YYYYMMDD.{tar.gz,zip} - A distribution containing source code and a web application archive for each example application that is available. Currently, the available examples are: shale-blank, shale-clay-usecases, shale-mailreader, shale-sql-browser, and shale-usecases.

The following were the latest Shale downloads on June 2, 2007

  • shale-framework-20070602.zip
  • shale-starter-20070602.zip
  • shale-blank-20070602.zip
  • shale-dependencies-20070602.zip

Then you'll need to download the libraries that those projects are dependent on:

Add the Shale libraries to your Web app

Your next step is to add all the Shale JAR files and libraries into a location where your Web application can access and use them. Here are the steps you should take:

  1. If you don't have a JSF installation in your servlet engine, copy shale-framework-20070602/lib/jsf-ri/jsf-api.jar and shale-framework-20070602/lib/jsf-ri/jsf-impl.jar into your application's WEB-INF/lib directory.
  2. Copy shale-core.jar from your shale-framework-20070602/dist/ directory into the WEB-INF/lib directory of your Web application.
  3. Copy the following Shale dependencies into your Web application's WEB-INF/lib directory:
    • shale-framework-20070602/lib/commons-beanutils/commons-beanutils.jar
    • shale-framework-20070602/lib/commons-chain/commons-chain.jar
    • shale-framework-20070602/lib/commons-digester/commons-digester.jar
    • shale-framework-20070602/lib/commons-logging/commons-logging.jar
    • shale-framework-20070602/lib/commons-validator/commons-validator.jar  

      Continued.....


1  |  2  |  3  |  4  |  5  | Articles Home

Test
About Us | Our Mission | Terms of use | Author Terms |    Search        | Contact Us | Advertise With Us | Link to Us | Sitemap
Copyright © 2016 developersBOOK.COM. All rights reserved.