Contents. 1. JSF overview. 2. JSF example

Similar documents
Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum

Oracle Developer Day

Getting Started Guide. Version 1.7

Oracle Fusion Middleware 11g: Build Applications with ADF I

Introduction to Java Server Faces(JSF)

04/29/2004. Step by Step Guide for Building a simple JSF Application (Guess a Number) - V1.0

JSF. What is JSF (Java Server Faces)?

Three hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Friday 21 st May Time:

Session 24. Introduction to Java Server Faces (JSF) Robert Kelly, Reading.

Oracle Fusion Middleware 11g: Build Applications with ADF I

JSF Page Navigation. The first example we ll look at is available as jsf_ex2a.zip on your notes page.

Java EE 6: Develop Web Applications with JSF

Java TM. JavaServer Faces. Jaroslav Porubän 2008

Example jsf-cdi-and-ejb can be browsed at

3.2 Example Configuration

Developing Applications with Java EE 6 on WebLogic Server 12c

SECTION II: JAVA SERVLETS

Contents at a Glance

JSF Tools Reference Guide. Version: M5

Author: Sascha Wolski Sebastian Hennebrueder Tutorials for Struts, EJB, xdoclet and eclipse.

Hello Worldwide Web: Your First JSF in JDeveloper

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

Developing Web Applications with ArcGIS Server. Kevin Deege Educational Services ESRI-Washington DC

TheServerSide.com TheServerSide.NET Ajaxian.com

Jakarta Struts: An MVC Framework

Improve and Expand JavaServer Faces Technology with JBoss Seam

Web Application Architecture (based J2EE 1.4 Tutorial)

Advanced Web Technology - Java Server Faces

Developing Web Applications using JavaServer Faces

JavaEE Interview Prep

JBoss SOAP Web Services User Guide. Version: M5

JBoss WS User Guide. Version: CR1

Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand)

SERVICE TECHNOLOGIES

JSF Tools Reference Guide. Version: beta1

Oracle Fusion Middleware 11g: Build Applications with ADF Accel

Sun Java Studio Creator. Ken Paulsen Staff Engineer Sun Microsystems, Incorporated (Slides by: Craig R. McClanahan)

SSC - Web applications and development Introduction and Java Servlet (I)

Distributed Multitiered Application

Table of Contents. Introduction... xxi

Java EE 7 is ready What to do next? Peter Doschkinow Senior Java Architect

JavaServer Faces Programming By Budi Kurniawan READ ONLINE

JDK-WildFly-NetBeans Setup Local

CHAPTER 6. Organizing Your Development Project. All right, guys! It s time to clean up this town!

Building the Enterprise

SAP NetWeaver J2EE Preview: User Interfaces with JSF

Seam 3. Pete Muir JBoss, a Division of Red Hat

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

112-WL. Introduction to JSP with WebLogic

Building JavaServer Faces Applications

JSF Validating User Input

Table of Contents Fast Track to JSF 2

Oracle Developer Day

Author - Ashfaque Ahmed

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

One application has servlet context(s).

JSF 2.0: Insight and Opinion

Fast Track to Java EE 5 with Servlets, JSP & JDBC

JBoss WS User Guide. Version: GA

Enterprise Java Unit 1-Chapter 2 Prof. Sujata Rizal Java EE 6 Architecture, Server and Containers

CPET 581 E-Commerce & Business Technologies. Topics

INTRODUCTION TO SERVLETS AND WEB CONTAINERS. Actions in Accord with All the Laws of Nature

<Insert Picture Here> Hudson Web Architecture. Winston Prakash. Click to edit Master subtitle style

Oracle 10g: Build J2EE Applications

Courses For Event Java Advanced Summer Training 2018

Oracle Developer Day

Java Training Center, Noida - Java Expert Program

Oracle Middleware 12c: Build Rich Client Applications with ADF Ed 1 LVC

SOFTWARE DEVELOPMENT SERVICES WEB APPLICATION PORTAL (WAP) TRAINING. Intuit 2007

JSF - Facelets Tags JSF - template tags

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

JSF 2.0: Insight and Opinion

JSF: Introduction, Installation, and Setup

and JBoss Seam Beginning JSF 2 APIs JSF 2 APIs and JBoss Seam Kent Ka Iok Tong Beginning Beginning JSF 2 APIs and JBoss Seam Tong

JavaServer Faces Technology, AJAX, and Portlets: It s Easy if You Know How!

Building Web Applications With The Struts Framework

Specialized - Mastering JEE 7 Web Application Development

Hands-on Development of Web Applications with Java EE 6

web.xml Deployment Descriptor Elements

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

ADVANCED JAVA COURSE CURRICULUM

IBM. IBM WebSphere Application Server Migration Toolkit. WebSphere Application Server. Version 9.0 Release

A Gentle Introduction to Java Server Pages

ADF OAF Who Cares? You Do! Oracle Applications Framework / Application Development Framework - Which way do I go?

PROCE55 Mobile: Web API App. Web API.

CSE 336. Introduction to Programming. for Electronic Commerce. Why You Need CSE336

PHP Development for ClearPath. Session 3028, Tuesday, May 15, 2012, 10:30AM Ron Neubauer, Principal Engineer, Unisys Corporation

Building Web Applications with SAS AppDev Studio TM 3.0

SSC - Web development Model-View-Controller for Java Servlet

Java.. servlets and. murach's TRAINING & REFERENCE 2ND EDITION. Joel Murach Andrea Steelman. IlB MIKE MURACH & ASSOCIATES, INC.

open source community experience distilled

Enterprise Java Technologies (Part 1 of 3) Component Architecture. Overview of Java EE. Java Servlets

Eclipse Java Ejb 3.0 Tutorial For Beginners With Examples Pdf

Ch04 JavaServer Pages (JSP)

UIMA Simple Server User Guide

ECLIPSE TUTORIAL HOW TO WRITE JAVA PROGRAM IN ECLIPSE STEP BY STEP ECLIPSE TUTORIAL FOR BEGINNERS JAVA

2007 Marty Hall Marty Hall. 5 J2EE training: Marty Hall Marty Hall

Rational Application Developer 7 Bootcamp

Simplifying GWT RPC with

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

Transcription:

Introduction to JSF

Contents 1. JSF overview 2. JSF example 2

1. JSF Overview What is JavaServer Faces technology? Architecture of a JSF application Benefits of JSF technology JSF versions and tools Additional JSF technologies 3

What is JavaServer Faces Technology? JavaServer Faces (JSF) technology is a server-side framework for Java-based Web applications JSF technology provides an API for: Representing UI components in a Web app Managing the state of UI components Handling events Validating user input Converting data Defining page navigation Supporting internationalization and accessibility 4

Architecture of a JSF Application Web container, e.g. GlassFish, JBoss, Jetty, Tomcat Browser at the client computer HTTP request to JSP page JavaServer Faces Web Page Web page contains JSF tags, defining UI of Web page HTTP response JavaServer Faces UI components Java objects that correspond to the tags in the Web page Event listener objects Validator objects Data converter objects Data encapsulation objects 5

Benefits of JSF Technology Clean separation between presentation and behaviour You can map HTTP requests directly to event-handler methods on Java components (similar to event-handling in rich-client apps) Separation of development roles Page authors Application developers Component writers Application architects Tool vendors 6

JSF Versions and Tools Versions JSF 1.1, 1.2 JSF 2 See JSF Mojarra: https://javaserverfaces.dev.java.net/ Standard part of Java EE 6 onwards Popular JSF tools: Oracle JDeveloper BEA Workshop Studio Sun Java Studio Creator Eclipse NetBeans 7

Additional JSF Technologies During this course we'll also take a look at: JSF and Ajax Facelets Most of these technologies and/or tools provide: Additional libraries that you must deploy to the Web container Configuration info that you must add to the JSF config file Tags that you can add to JSP pages 8

2. JSF Example Overview Creating a new project JSF configuration Using JSF components in a Web page Requesting the Web page 9

Overview This section shows how to use Eclipse to: Create a JSF-enabled Web application Add JSF components to a Web page View the configuration info for the Web application Run the application 10

Creating a New Project (1 of 4) Every IDE has its own foibles we'll show how to proceed with Eclipse as a concrete example The first step is to create a new Dynamic Web Project 11

Creating a New Project (2 of 4) Specify the name and target runtime of the project Also, modify the configuration to include the JSF project facet 12

Creating a New Project (3 of 4) In the Web Module page, select the option to generate a web.xml file Even though web.xml isn't strictly needed in Java Web apps these days, it's almost always useful to have it 13

Creating a New Project (4 of 4) In the JSF Capabilities page, select the following options to generate a faces-config.xml file Even though faces-config.xml isn't strictly needed in JSF apps these days, it's almost always useful to have it 14

JSF Configuration (3 of 3) Here's the initial faces-config.xml file: <?xml version="1.0" encoding="utf-8"?> <faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"> </faces-config> faces-config.xml 15

Web Application Configuration JSF-enabled web applications also have an entry (or multiple entries) in web.xml Here's web.xml for our simple Web application: <web-app > <servlet> <servlet-name>faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.facesservlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> </web-app> web.xml 16

Using JSF Components in a Web Page <%@ page %> <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <html> <body> <f:view> <% for (int i=0; i < 5; i++) { %> Here is some static text. <br> <h:outputtext value="and here's some JSF static text." /> <br><br> <% } %> </f:view> </body> </html> index.jsp 17

Requesting the Web Page Here's how the JSP page appears when you request it Note the URL! 18

Summary JSF is a Java Web technology that decouples the UI from the model Use JSF components to represent the UI Define backing beans to implement the model Configuration files: faces-config.xml (optional) - backing beans, navigation, etc. web.xml - installs the Faces servlet JSF tag library URLs: <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> 19