CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.

Slides:



Advertisements
Similar presentations
 2002 Prentice Hall. All rights reserved. Chapter 9: Servlets Outline 9.1 Introduction 9.2 Servlet Overview and Architecture Interface Servlet and.
Advertisements

Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Chapter 51 Scripting With JSP Elements JavaServer Pages By Xue Bai.
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.
JavaServer Faces. Objectives To implement dynamic web pages with JavaServer Faces (JSF) technology To learn the syntactical elements of JavaServer Faces.
JSP Java Server Pages Reference:
Python and Web Programming
Java Server Faces Model/View/Controller Design Pattern for Web Development Slides adapted from “Core JavaServer Faces” by Geary and Horstmann and the J2EE.
Q: According to Intel, the Pentium conforms to the IEEE standards 754 and 854 for floating point arithmetic. If you fly in aircraft designed using a Pentium,
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
CSCI 6962: Server-side Design and Programming History and Background.
UNIT-V The MVC architecture and Struts Framework.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CPSC 203 Introduction to Computers Lab 39, 40 By Jie (Jeff) Gao.
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.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Agenda Web Development Chapter 7 Review Class Discussion Issues.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
WEB FORM DESIGN. Creating forms for a web page For your web project you have to design a form for inclusion on your web site (the form information should.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
CSCI 6962: Server-side Design and Programming Validation Tools in Java Server Faces.
CSC 2720 Building Web Applications Using Java Beans, Custom Tags and Tag Libraries in JSP pages.
CSCI 6962: Server-side Design and Programming Support Classes and Shopping Carts.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
JSP Java Server Pages Softsmith Infotech.
Introduction to JavaServer Pages (JSP) Slides from Dr. Mark Llewellyn.
Web applications using JavaServer Faces (JSF) A brief introduction 1JavaServer Faces (JSF)
CSCI 6962: Server-side Design and Programming Java Server Faces Components and Tags.
CSCI 6962: Server-side Design and Programming Web Services.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
CPSC 203 Introduction to Computers Lab 23 By Jie Gao.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
CSCI 6962: Server-side Design and Programming AJAX Tools in JSF and ASP.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
DAT602 Database Application Development Lecture 16 Java Server Pages Part 2.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
CSCI 6962: Server-side Design and Programming Java Server Faces Scoping and Session Handling.
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Chapter 4: Working with ASP.NET Server Controls OUTLINE  What ASP.NET Server Controls are  How the ASP.NET run time processes the server controls on.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 41 JavaServer Face.
Producing a high-impact web experience by integrate Macromedia Flash and ASP By Katie Tuttle CS 330: Internet Architecture and Programming Project.
CSCI 6962: Server-side Design and Programming JSF DataTables and Shopping Carts.
CSCI 6962: Server-side Design and Programming Facelets and User Interface Design.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
Lecy ∙ Data-Driven Management Lecture 12 Building Shiny Apps.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
WEB FORM DESIGN. Creating forms for a web page For your web project you have to design a form for inclusion on your web site (the form information should.
1 State and Session Management HTTP is a stateless protocol – it has no memory of prior connections and cannot distinguish one request from another. The.
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Java Server Pages. 2 Servlets The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
PostBack  When an initial request for a page (a Web Form) is received by ASP.NET, it locates and loads the requested Web Form (and if necessary compiles.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
Teaching slides Chapter 6. Chapter 6 Software user interface design & construction Contents Introduction Graphical user interface – Rich window based.
Presentation transcript:

CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces

Outline Model-based architectures and value binding Creating JSF page and managed beans in NetBeans Adding member variables to managed beans Basic JSF tags Binding variables to JSF form elements

Java Server Faces Model-based architecture J Java Server Faces page User interface components Managed Bean Support class Data storage and manipulation Validation Navigation and redirection Long term data storage (sessions, databases, etc.) J JSF J Bean

Java Server Faces Value Binding Form elements can be directly linked to variables inside bean Changing values on form changes value of those variables when form submitted

Creating a JSF New Project  Java Web  Web Application Enter name and press NEXT twice (not finish) Check Java Server Faces under Frameworks

Creating a JSF Page New File  Web  JSF Page Make sure Facelets selected

Creating a Managed Bean New File  Java Server Faces  JSF Managed Bean Give it a name and a package Set its scope to request (for now)

Managed Beans Generated bean file contains – Name that any JSF can use to refer to it – Scope for which bean exists Request (single page) Session (multiple pages in same user session) Application (accessible by all user sessions)

Defining Member Variables Data stored or computed by bean Any form elements bean binds to Must be type String for text elements

Getter/Setter Methods Each member variable variable should have methods – public String getVariable() – public void setVariable(String) Required if variable bound to form element – Get called when page loaded to insert value – Set called when form submitted to change bean value Done “behind the scenes” with request.getParameter calls

Getter/Setter Methods Can use ALT-INSERT to do automatically

Java Server Faces Tags JSF tags instead of html

Java Server Faces Tags JSF tags instead of html – Tags of form or (XML syntax) – Many similar in form to html tags – Tag libraries set in enclosing html tag – Reference:

Java Server Faces Tags Translated to html in response sent to client

JSF Text Input Goal: Bind input field to member variable in bean – Form submitted  variable value updated automatically – Page sent back as response  variable value automatically inserted Syntax:

JSF Text Output Like input field, but “read only” – Variable value automatically inserted into response – Translated into simple text Syntax:

JSF Submit Buttons Syntax: Note that address defined in button rather than form – Crucial for bean-directed redirection

Computed Values Can bind to computed values instead of bean variables Example: – Bean computes cost of widget order – Receipt gets and displays that value

Computed Values Must define get and set method for input field Must define set method for input field Cost not a member variable getCost computed from member variables

Initial Values Can load values into form elements when page loaded Assign corresponding bean variables initial values

JSF/Bean Lifecycle Request for JSF page (initial form request) J JSF J Bean bean constructed (if it does not already exist) bean values loaded into bound elements using get methods J html Sent as html form Form submitted Parameter values parsed parameter values from bound elements stored in bean using set methods