Web applications using JavaServer Faces (JSF) A brief introduction 1JavaServer Faces (JSF)

Slides:



Advertisements
Similar presentations
DT228/3 Web Development WWW and Client server model.
Advertisements

Web applications using Java and NetBeans
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
ISYS 546 Client/Server Database Application Development.
Apache Tomcat Server – installation & use Server-side language-- use Java Server Pages Contrast Client-side languages HTML Forms Servers & Server-side.
Layers & Tiers Umair Javed Lec - 41.
DT211/3 Internet Development Application Internet Development Application.
Java Server Faces Model/View/Controller Design Pattern for Web Development Slides adapted from “Core JavaServer Faces” by Geary and Horstmann and the J2EE.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
UNIT-V The MVC architecture and Struts Framework.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
INTRODUCTION TO WEB DATABASE PROGRAMMING
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
11. Java-Based Web: JSP, JSF. 2 Motto: Rule 1: Our client is always right Rule 2: If you think our client is wrong, see Rule 1. - Anonymous.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
HTML Forms and Scripts. Session overview What are forms? Static vs dynamic Client-side scripts –JavaScript.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
JavaServer Faces Jeff Schmitt October 5, Introduction to JSF Presents a standard framework for building presentation tiers for web applications.
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
Web applications using JavaServer Faces (JSF) A brief introduction 1JavaServer Faces (JSF)
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Fall CIS 764 Database Systems Design L8. Web ….
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 Welcome to CSC 301 Web Programming Charles Frank.
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
3-Tier Web Application Architecture. Simple Log-in public String button1_action() { // TODO: Process the button click action. Return value is a navigation.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
CSCI 6962: Server-side Design and Programming Java Server Faces Scoping and Session Handling.
CSC 2720 Building Web Applications Frameworks for Building Web Applications.
JavaServer Faces (JSF) and Ajax Integration. Agenda 대강의 ( 정말로..) 개요 예제 아키텍트라면..
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 41 JavaServer Face.
Markus Hjort Reaktor Innovations Java Web Development T WWW-palvelun HUT
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
The basics of knowing the difference CLIENT VS. SERVER.
JavaServer Faces framework Craig McClanahan is presented that created Struts web framework and based on experience gathered designed JavaServer.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Database application development 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall OBJECTIVES  Define terms  Explain three components.
1 LM 6 Database Applications Dr. Lei Li. Learning Objectives Explain three components of a client-server system Describe differences between a 2-tiered.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 9 Case Study.
Intro to JavaServer Faces Mimi Opkins CECS 493 Fall 2016.
Teaching slides Chapter 6. Chapter 6 Software user interface design & construction Contents Introduction Graphical user interface – Rich window based.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Structure of a web application
Chapter 44 JavaServer Face
Unit 6-Chapter 2 Struts.
Design and Maintenance of Web Applications in J2EE
ISE 390 Dynamic Web Development
Distributed System Using Java 2 Enterprise Edition (J2EE)
Chapter 39 JavaServer Face
JavaServer Faces: The Fundamentals
Web Servers (IIS and Apache)
Intro to J2EE Concepts.
Presentation transcript:

Web applications using JavaServer Faces (JSF) A brief introduction 1JavaServer Faces (JSF)

What is JavaServer Faces (JSF)? Framework for web applications – Works on the server side Part of Java Enterprise Edition – Runs on an application server with a JSF container Example: GlassFish 2JavaServer Faces (JSF)

Some web technologies Client-side technologies (X)HTML JavaScript Cascading Styles Sheets (CSS) Java Applets Server-side technologies Java Servlets JavaServer Pages (JSP) JavaServer Faces (JSF) PHP Microsoft ASP.NET web forms 3JavaServer Faces (JSF)

JSF Pages JSF Pages look like HTML pages Application server translates JSF Pages to HTML pages – The HTML is then send to the client (browser) The translation is dynamic – Depends on the state of Java objects JSF Managed Beans Syntax: #{beanName.propertyName} 4JavaServer Faces (JSF)

NetBeans support 5JavaServer Faces (JSF)

JSF managed beans Value expression – #{beanName.propertyName} – Invokes a method on a Java object Called a JSF managed bean JavaBeans controlled by JSF Example: showTime 6JavaServer Faces (JSF)

JavaBeans No-arguments constructor Properties – Get + set methods – Public type getPropertyName() – Public void setPropertyName(Type newValue) – Can be read-only No set method, only a get method Other methods Implements java.io.Serializable The model component in the Model-View-Controller architecture (MVC) Example: showTime -> TimeBeans 7JavaServer Faces (JSF)

Scope of managed beans Who can access a bean – and for how – Available throughout a single HTTP request. – Survives forwarding to another – Stored in the HTTP session – Each user has a HTTP session – Time out – Example: Shopping cart – Examples from “Big Java” – Available throughout the life of the application – Accessible to all users and all pages Example: counters2 8JavaServer Faces (JSF)

Separation of concerns: Presentation and Business Logic Presentation – User interface – JSF Page Also known as Facelet – Made by graphics designers Business logic – Rules for business decisions – JSF managed JavaBean – Made by Java programmers 9JavaServer Faces (JSF)

Navigation between pages Command button – – Example: personalInfo – Action can be a static name, or a method expression Action=”#{bean.method}” The method produces a String depending on the bean object’s state – The name of the page to navigate to – Similar 10JavaServer Faces (JSF)

JSF components JSF components are translated into HTML elements using value expressions Example – Examples: – personalInfo 11JavaServer Faces (JSF)

Validators: Checking the users input Required field – The input field cannot be left empty – Minimum length of a text input Range of an number input You can make your own validators – To validate the structure of an address, etc. JavaServer Faces (JSF)12

Three-tier applications Presentation tier – Browser Business logic tier – JSF Container JSF pages + managed beans Managed beans can make connections to a database Storage tier – Database Management System (DBMS) Database 13JavaServer Faces (JSF)

JSF using MVC But where is the controller? Model – JSF managed beans View – JSF page Controller – Javax.faces.webapp.FacesServlet pp/FacesServlet.html pp/FacesServlet.html – Reads WEB-INF/web.xml from the project – Dispatches the request to the right JSF page 14JavaServer Faces (JSF)

Declarative programming A program that describes what computation should be performed and not how to compute it. – Examples: – SQL, executed by a DBMS – HTML + CSS, executed by a web browser = "user") Executed by a JSF container (application server) 15JavaServer Faces (JSF)

References and further readings Horstmann: Big Java 4th edition, Wiley 2010 – Chapter 23 Web Applications, page The Java EE 6 Tutorial, Part III The Web Tier – Geary & Horstmann: Core JavaServer Faces, 3 rd edition, Prentice Hall 2010 Burns & Schalk: JavaServer Faces 2.0: The Complete Reference, McGraw-Hill 2011 Hall: JSF 2.0 Tutorials, ${coreservlets.com} – JSF 2.0 Support in NetBeans IDE – JavaServer Faces (JSF)