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

Slides:



Advertisements
Similar presentations
ISE 390 Dynamic Web Development Java EE Web Applications.
Advertisements

Web applications using Java and NetBeans
Web applications using JavaServer Faces (JSF) A brief introduction 1JavaServer Faces (JSF)
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
IS 360 Course Introduction. Slide 2 What you will Learn (1) The role of Web servers and clients How to create HTML, XHTML, and HTML 5 pages suitable for.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
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.
Multiple Tiers in Action
Apache Tomcat Server Typical html Request/Response cycle
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.
Structure of a web application1 Dr Jim Briggs. MVC Structure of a web application2.
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.
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.
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 14 Networks, Multi-Tier Architectures, and XML.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
® 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.
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.
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 대강의 ( 정말로..) 개요 예제 아키텍트라면..
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
© 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.
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
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.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
Java Programming, 3e Concepts and Techniques Chapter 1 Section 56 – An Introduction to Java.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
Java Web Development with NetBeans IDE -- Kai Qian Chapter 9 Case Study.
Intro to J2EE Concepts Mimi Opkins Fall 2016 CECS493.
Structure of a web application
Chapter 44 JavaServer Face
Design and Maintenance of Web Applications in J2EE
MSIS 655 Advanced Business Applications Programming
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 Current version – JSF 2.0, JavaServer 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 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) 7JavaServer Faces (JSF)

Scope of managed beans Who can access a bean – and for how – Available throughout a single HTTP request. – Survives navigation to another – Available on a single page / single HTTP – 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: counters 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 – – 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 – Example: LotteryGame 11JavaServer Faces (JSF)

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 12JavaServer Faces (JSF)

Database connections from JSF managed beans JSF Managed beans can be annotated name”) private DataSource source; – Called “resource injection” – Connection pooling – Using the connection object Connection conn = source.getConnection() 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.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 Executed by a JSF container (application server) name”) 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 II 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)