Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword or section
Like this

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
JSF Tutorial for RAD

JSF Tutorial for RAD



|Views: 3,856|Likes:
Published by api-3819398

More info:

Published by: api-3819398 on Oct 17, 2008
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Create Web-based user interfaces
Skill Level: IntroductoryRon Ben-Natan(rbennata@hotmail.com) Freelance writer19 May 2005This tutorial demonstrates how to use JavaServer Faces (JSF) technology within IBMRational Application Developer Version 6.0. The tutorial walks you through a simpleapplication example that uses JSF technology to implement a simple messagingcenter. Using Rational Application Developer, see how easy it is to build Webapplications that are based on JSF technology and how easy it is to support functionsrelating to event handling, validation, and navigation using visual tools anddeclarations rather than having to write long, tedious code.
Section 1. Before you start
About this tutorial
This tutorial is written for Web developers or Web site builders who want to quicklylearn how to use IBM® Rational® Application Developer Version 6.0 to build Webapplications that use JavaServer Faces (JSF) technology. This tutorial assumes abasic knowledge of HTML and the Java™ language. However, because RationalApplication Developer is easy to use, you'll find the tutorial easy to follow even ifyou're a beginner to HTML and the Java language.JSF is an application framework for creating Web-based user interfaces (UIs). Thistutorial illustrates how to develop a Web application using JSF technology with afocus on the visual tools provided for building Faces pages within RationalApplication Developer Version 6.0. It shows you how to use the JSF tags, how todefine validation within your Web forms, how to define navigation between thedifferent Web pages, and how to define what takes place when a button is clicked.Finally, the tutorial shows you what happens behind the scenes, what JSFconstructs Rational Application Developer generates, and how all this works. Whileyou will learn the basics of JSF, you won't become an expert in JSF and its verylarge feature set. For a great introduction to JSF, see the developerWorks tutorial,UI
Create Web-based user interfaces © Copyright IBM Corporation 1994, 2006. All rights reserved.Page 1 of 46
development with JavaServer Faces, by Jackwind Li Guojie.The tutorial uses a simple application -- the messaging center. Using the messagingcenter, users can log in and view messages that have been sent to them. They canalso send messages to any other user that has access to the messaging center.Because JSF technology brings visual graphical user interface (GUI) development toWeb applications, the focus is from the "outside-in" -- that is, starting with the pages,then filling in the blanks. Therefore, you first design the pages, then assign values toattributes belonging to components on your page and write only code that is notgenerated on your behalf.The messaging center application you create is not complete, because the purposeof the tutorial is to show you how to use JSF within Rational Application Developer.So, you won't spend any extra time making the application complete unless itteaches you something about JSF.The tutorial takes you through the entire development and packaging lifecycle. Youwill:Create a JSF project and your first JSF page for allowing users to log intothe messaging center.Learn how to use the palette and the Attributes Editor to design pages.Learn about user interface (UI) components, validation, error handling,and navigation.Learn all about
Backing Beans,
which are classes that RationalApplication Developer generates in support of UI components. You willput your event-handling code inside this bean.Learn about Managed Beans and models and see how to manage datathat needs to be shared among all pages. You will also see how to usethe JSF Expressions Language (JSF EL) to bind components to data.Build the inbox page and use a fairly complex data grid component.Finish building the application, test it, package it an as Enterprise Archive(EAR), and learn how to install it on a computer running IBMWebSphere® Application Server.
If you are a complete newbie to the Java programming language, some of theseconcepts might be easier to follow if you have a basic understanding of servlets andJavaServer Pages (JSP) technology. SeeResourcesfor some links on these topics.Otherwise, while this tutorial does not aim to be a complete overview of JSF, it doesgive you a pretty good overview of the main features. For more information on JSF,seeResourcesfor some excellent tutorials and sources.To run the examples in this tutorial, you need Rational Application Developer
developerWorks® ibm.com/developerWorksCreate Web-based user interfacesPage 2 of 46© Copyright IBM Corporation 1994, 2006. All rights reserved.
Section 2. JSF basics
JSF is a component-based framework that brings advanced UI developmentmethods to the world of Java-based Web applications. If you're familiar withMicrosoft® .NET technologies, think of JSF as the equivalent to the WebFormstechnology. By using JSF, you can easily create Web applications with complex UIsusing a minimal amount of effort. JSF includes two main modules: an API forrepresenting UI components and managing their state, and a JSP custom tag libraryfor making these UI components available in JSP pages.Additional attributes that make JSF so powerful include:JSF gives you a set of standard and reusable server-side componentsthat support multiple rendering options. You use these components toassemble pages and can later define how they are rendered. HTMLrendering is certainly the most common option, but in the same way thatsome people render Swing components as Scalable Vector Graphics(SVG) (for example, see the Batik project at apache.org), you might wantto render JSF components using other presentation capabilities in thefuture.JSF encapsulates event handling, validation, and navigation in a way thatmakes it declarative and very easy to use. The model follows the Swingmodel with event handlers and listeners, meaning that if you are familiarwith this model (or other Model-View-Controller (MVC)-like models), youwill find JSF quite natural.JSF provides a framework and APIs for allowing you to create customcomponents and extend existing ones. This topic is more advanced, and Idon't cover it in this tutorial. Refer to theResourcesfor more on customcomponents in JSF.Finally, JSF allows tool vendors to manage JSF components within anIntegrated Development Environment (IDE) such as Rational ApplicationDeveloper. As you'll see, JSF components are placed on palettes andhave attribute editors.
JSF lifecycle
ibm.com/developerWorks developerWorks® Create Web-based user interfaces © Copyright IBM Corporation 1994, 2006. All rights reserved.Page 3 of 46

Activity (33)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Havi Chavvakula liked this
jayavardhankoti liked this
sudacacqbo liked this
mohdsalmanabd liked this
naelkhw liked this
anilicon liked this
JayaPrabahar liked this
paulsundarsingh liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->