® IBM Software Group © 2006 IBM Corporation Web JSF Overview – Dynamic Content Web Pages – for EGL/JSF Developers This unit introduces you to the technical.

Slides:



Advertisements
Similar presentations
The Web Warrior Guide to Web Design Technologies
Advertisements

1 Chapter 12 Working With Access 2000 on the Internet.
DT211/3 Internet Application Development JSP: Processing User input.
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
® IBM Software Group © 2006 IBM Corporation Additional AJAX Examples and Workshops This learning module provides additional AJAX use cases and examples.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
® IBM Software Group © 2006 IBM Corporation EGL / SOA – Creating and Consuming EGL Web Services This Learning Module shows how to utilize the RBD tooling.
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
® IBM Software Group © 2006 IBM Corporation JSF Menu Component How to create and use JSF Menu components to add custom static and programmatic (dynamic)
® IBM Software Group © 2006 IBM Corporation EGL/Web Project QuickStart – 3 of 4 – Creating the U.I. Layer These slides walk you through the process of.
® IBM Software Group © 2006 IBM Corporation How to read/write XML using EGL This Learning Module shows how to utilize an EGL Library to read/write an XML.
Struts 2.0 an Overview ( )
UNIT-V The MVC architecture and Struts Framework.
® IBM Software Group © 2006 IBM Corporation JSF Tab Controls This Learning Module shows how to develop server-side EGL applications with dynamic content.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
® IBM Software Group © 2006 IBM Corporation Display contents of a Data Table in Excel right from the browser – No POI needed This section describes how.
Copyright 2008, Synchrony Systems, Inc. Legacy TUI to EGL/Web Application Modernization Enterprise Modernizations.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
® IBM Software Group © 2006 IBM Corporation Creating JSF/EGL Template Pages This section describes how to create.JTPL (Java Template Pages) using the Page.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
® IBM Software Group © 2006 IBM Corporation JavaScript – and EGL and.JSP Pages This learning module describes the use of JavaScript in your EGL and.JSP.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
® IBM Software Group © 2006 IBM Corporation JSF Tree Control This Learning Module describes the use of the JSF Tree Control – for hierarchical organization.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JSP Java Server Pages Softsmith Infotech.
JavaServer Faces Jeff Schmitt October 5, Introduction to JSF Presents a standard framework for building presentation tiers for web applications.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
® IBM Software Group © 2006 IBM Corporation Programmatically Rendering and Hiding JSF Controls This section describes how to hide and show JSF controls.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
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.
® IBM Software Group © 2006 IBM Corporation JSF/EGL Component Properties Deep Dive This section walks you through the options and settings for JSF Component.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
® IBM Software Group © 2006 IBM Corporation Web JSF Overview – Internet “101” for EGL/JSF Developers This unit introduces you to the technical concepts.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
® IBM Software Group © 2006 IBM Corporation.JSP Page Flow – and Managing State in your Web Application This learning module covers the salient features.
® IBM Software Group © 2006 IBM Corporation JSF Progress Bar This Learning Module shows how to integrate EGL/JSF functionality into a run-time progress.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
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.
® IBM Software Group © 2006 IBM Corporation Individual Cell Coloring – in a JSF dataTable Control You may need to programmatically (using EGL) change the.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
® IBM Software Group © 2006 IBM Corporation Using JSF Mini-Calendar Controls This section describes how to use a JSF Mini-Calendar Control with EGL It.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 41 JavaServer Face.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Application: Middle Tier Introducing Code-Behind Files, Session State.
® IBM Software Group © 2006 IBM Corporation JSF File Upload Control This Learning Module describes the use of the JSF File Upload component – for allowing.
® IBM Software Group © 2006 IBM Corporation Web JSF Overview – RBD Tooling – for Web Development This unit introduces you to the aspects of the RBD tooling.
® IBM Software Group © 2006 IBM Corporation “Essential” JSF Components and EGL Bindings This Learning Module describes the foundation terms and concepts.
® IBM Software Group © 2006 IBM Corporation Finding Out Which Submit Button Was Clicked – and Other JSF Command Button Techniques This section describes.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
® IBM Software Group © 2006 IBM Corporation JSF Panel – Section Controls This Learning Module shows how to develop server-side EGL applications with dynamic.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
® IBM Software Group © 2006 IBM Corporation JSF Rich Text Area Component This Learning Module describes the use of the JSF Rich Text Area component – for.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
® IBM Software Group © 2006 IBM Corporation Dependent Combo-Box U.I. Development This Learning Module walks you through the options and development techniques.
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
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.
® IBM Software Group © 2006 IBM Corporation EGL.CSV (Excel) File Reading and Writing This section describes how to access.CSV (Excel Spreadsheet) files.
® IBM Software Group © 2006 IBM Corporation Create EGL/JSF HelloWorld Pages This learning module walks you through the process of creating two simple “hello.
Web JSF Overview – Dynamic Content Web Pages – for EGL/JSF Developers
Presentation transcript:

® IBM Software Group © 2006 IBM Corporation Web JSF Overview – Dynamic Content Web Pages – for EGL/JSF Developers This unit introduces you to the technical concepts of dynamic content web pages, the JSF lifecycle on the web, and the EGL JSFHandler properties.

2 Last update: 12/04/2007 Topic Objectives  Sub-topics for this section:  Internet “101”  Lifecycle  URL/URI  Browser technology .CSS  Dynamic Content Web Pages – terms and concepts  JSPs and Servlets  JSF –Terms and concepts –Lifecycle  EGL and JSF  Faces-config.xml  RBD Tooling  Template pages  Customizing the palette

3 Last update: 12/04/2007 Dynamic Data Content Web Technology  Using EGL and JSF you create web pages that render data dynamically  Translation – the data ultimately viewed by your users in the browser will be:  Dynamically read from a database (using EGL data access statement)  Processed by EGL business logic – which creates data bound to JSF components  Which are processed by JSP/Servlet technology and ultimately  Displayed in HTML pages. See Notes for additional details ApplicationServer EGL Application Process data Access database Call legacy systems HTML +CSS + data HTTP Request DB Browser Pag e Data Transfer System I System z

4 Last update: 12/04/2007 J2EE Servlets and JSPs – “Geek Speak”  Servlets are modules of Java code that run inside a “Servlet container”*** (Notes) running in an application server (like WebSphere or Tomcat).  Servlets are the executable form of.JSP pages. And they are used to provide back-end (server/side) support for dynamic content applications, by:  Processing and/or storing data submitted by an HTML form  Dynamically rendering the HTML (tags + data) for a page  Java Server Pages (JSPs) are also modules of Java source code that get compiled and run on an application server.  JSPs are used to simplify the development of dynamic content web pages that interact with application processes (EGL) and databases (Java Servlet code is very complex to write. JSPs are much easier)  JSP pages exist in their source form, in your application.  When they are executed, the system compiles them to J2EE Servlets on-the-fly. Browser WebSphere Servlet Container Servlet Java (managed) Bean Your EGL JSFHandler Request (URI) Response (HTML + data)

5 Last update: 12/04/2007 Java Server Faces  Java Server Faces (JSF) is a Java-framework (pre-constructed code you use or call…versus having to write from scratch) for building Web applications using EGL generated to Java.  JSF provides you with the following features:  Dynamic Content rendering – generating browser-ready HTML tags and data  This complex, time-consuming and deep J2EE/Java development process becomes “declarative programming” using RBD and EGL  Page navigation specification  Standard user interface components like input fields, buttons, and links  User input validation  Easy error handling  Integration with EGL  Binding components to EGL Page Data values  Binding Actions to EGL functions  Binding JSF properties to EGL Page Data values  Integration with Page Designer and other tools, such as:  Template pages and Site Designer  Event handling  Integration with client-side processing, including:  JavaScript  AJAX technology  In short, JSF provides the common plumbing for the U.I. elements of your Web application (just as EGL provides the plumbing for the business and data access logic) allowing you to concentrate on your business requirements (instead of worrying about things like how to create a link from one page to another).

6 Last update: 12/04/2007 JSF LifeCycle

7 Last update: 12/04/2007 faces-config.xml (Your Project’s Web Page “Table-of-Contents”)  faces-config.xml – a file inside the \WEB-INF\ folder (which is inside \WebContent\)  faces-config.xml is the Java Server Faces configuration file. This file lists Java resources (your compiled JSFHandlers) and the.JSP page navigation rules (links, etc.). Here’s an example…

8 Last update: 12/04/2007 JSFHandlers and EGL Business Logic  Your JSFHandler controls the user’s run-time interaction with a web-page. It is responsible for retrieving and processing data bound to variables displayed on the page, and for handling user events that fire server-side logic (i.e. the user clicks a submit-button or dataTable row, or makes a selection from a combo-box that invokes a custom function in a JSFHandler.) JSFHandlers adhere to the standard EGL coding model. They have properties Global variables (Page Data variables) And functions  Search Help on the topic: JSF Handler Part

9 Last update: 12/04/2007 The JSFHandler EGL Properties  You learned in the EGL Language tutorial about EGL properties for DataItems, Records and primitive variables.  You may also have noticed a number of interesting looking (okay – interesting may be a poor choice of words here) set of EGL properties that are associated with JSFHandlers.  There are about a dozen JSFHandler properties (properties that affect the code generation for the entire JSFHandler, or managed-bean).  The majority of the time you will not want to modify the JSFHandler property defaults (exceptions being: 1. cancelOnPageTransition, 2. msgResource (for internationalization) Properties of a JSFHandler  Other JSFHandler properties you may enable

10 Last update: 12/04/2007 Data Access Best Practices  Throughout the course we’ve used onConstruction as our primary initial page load function. This however may or may not be the best practice for pages that require data access on load.  It is best to put any long running initial data access queries in the onPreRender function.  Doing so will give you better control over your code and allow you to debug easier. This is because preRender runs each time the page loads no matter what.  Historically we’ve used onConstruction for every page that requires on load functionality. Ever since RBD v7.1, however, it has become optimal to use preRender when there is data access involved.

11 Last update: 12/04/2007 Three Important JSFHandler Functions  There are three reserved functions in all JSFHandlers:  onConstruction  For session scope pages** (see notes) This function is executed the first time the page (managed bean) is loaded from the server. It is not executed when a form is submitted.  For request scope pages** (see notes) This function is also executed upon every form submit (even if there is a validation error)  onPreRender  For both session and request scope pages, this function is executed after onConstruction() – if specified - and then upon every form submit (even if there is a validation error) BEFORE the page is rendered. It is typically used to do things such as refresh JSFHandler variables.  onPostRender  For both session and request scope pages this function is executed after onConstruction(), after onPreRender() – if specified – and then upon every form submit (even if there is a validation error) AFTER the page is Rendered. It is typically used to do things such as save variable values to session, etc. onConstruction(), preRender(), postRender():  onConstruction(), preRender(), postRender():  Are only executed if their associated JSFHandler properties specify a function onPrerenderFunction = onPreRender, onConstructionFunction = onConstruction…  Have access to all the functions and variables in the page  Can access parameters passed from a forward statement or from the query strings within a URL. The parameters persist as request data.  If the functions are defined without any parameters, any arguments passed to the function by a forward statement or a link are ignored, and the parameters assume their default values –int = 0, string = “” (empty string), date = current date, etc.

12 Last update: 12/04/2007 EGL and JSF Page Data – Referencing EGL Variables private  In order to make your EGL variables available to JSP pages, they must be defined as public variables ( not defined as private ).

13 Last update: 12/04/2007 Functions EGL and JSF Page Data – Referencing EGL Functions private  In order to make your EGL functions available to JSP pages, they must not have parameters in the function signature, and can not be designated as private functions. *** Notes

14 Last update: 12/04/2007 EGL and JSF – Value Bindings - Refactoring? (not)  As soon as you drag and drop or bind an EGL variable to its JSF component, the RBD tooling makes a JSF source statement entry and hard- wires a generated name for the value.  At this point in time you can not simply change either the name or even the case of your EGL JSFHandler variable - or any part of it (i.e. record name, field name, etc.) – as your change will not be refactored in the JSF source, and a run-time error will occur, as Java will be looking for (case and all) *** Notes  If you need to change EGL JSFHandler variable names, you can do so, if you re-drag the field from Page Data on top of the JSF component – and re-bind its value.  The above also holds true for JSF Submit Buttons (and the EGL functions that they invoke) – that is, once you drag the EGL functions onto a page and bind them to JSF Submit Buttons, if you change the function name, re-drag/bind. Time 1. Create a JSF component Time 2. Bind the component’s value to an EGL JSFHandler variable Time 3. Modify the spelling or case of the EGL variable name Time 4. Run the page on the server (will receive Java Run-time error)

15 Last update: 12/04/2007 EGL and JSF – Value Bindings – The Big Picture  (In Design Mode) Customer record dragged onto a page, which creates the form  – and individual controls to hold the record’s variable values – including the State variable  You can see this in source mode  updatecustomer2 = page name customer = record variable name State = field-within-record variable name JSFHandler Record Variable JSF Design Mode view JSF Source Mode view EGL Record Declaration (Field name)

16 Last update: 12/04/2007  JSF Properties  During page design, you may customize the JSF properties for the data and other elements of your page design.  This is done by selecting a field and accessing the Properties tab.  Properties has a default and an “All Attributes” view  Quick Workshop  Select any component on any page.  From Properties – switch back and forth from normal Properties to All Properties Properties All Attributes view

17 Last update: 12/04/2007 Selecting JSF Components in Page Designer  Selecting JSF Components in Page Designer There are four different ways of selecting controls in Page Designer  Mouse-select  Left-click the control in the Content Area  Keyboard select  (From any mouse-focus point in Page Designer) Move up/down and right/left using your keyboard  If you start from a component inside another component (example: a control within a dataTable) – the up arrow will select descendant/parent container components Note that you can combine the up/down/right/left arrow keys i.e. Use right arrow to navigate, left arrow to select  Properties menu select  Allows you to navigate to all JSF and HTML Tags on a page  For all complex components (container controls) you can access sub-properties not available from any other selection mode  Outline view 

18 Last update: 12/04/2007 JSF and HTML and JSF  Essentially, any JSF (Enhanced Faces) component can integrate and works with any other JSF component. For examples  You can drop a JSF Link on top of a JSF output field, or drop a JSF comboBox inside of a JSF dataTable, etc.  And any HTML Tag integrates and works with any other HTML Tag  You can put an HTML Link on an HTML image, etc. But (except for the HTML Table Tag and JSF Panel-Group Box/JSP) you cannot mix JSF and HTML. For example  You can NOT drop an HTML Link on a JSF output control.  You can NOT drop a JSF Link on an HTML image  Etc. BRICKWALL

19 Last update: 12/04/2007  Adding the JSF Component Tree Facets  You will want to use a powerful facility in EGL/JSF called the Component Tree. It will allow you to do U.I. dynamic programming without having to learn JavaScript. But this Component Tree feature must be enabled.  (From Project Explorer) Right-click over EGLWeb and select Properties (it’s the bottom option on the context menu) (From Project Facets) click: Add/Remove Project Facets Check:  EGL support with JSF Component Interfaces  Enhanced Faces components  Click Finish  Click OK

20 Last update: 12/04/2007 Testing Your Pages (Removing JSFHandler Beans From App-Server Cache Memory)  As will be explained in an upcoming unit on Session Management, your EGL JSFHandler files (the java “page beans”) can often be held in persistent memory by your application server (either WebSphere or Tomcat). The App-Servers do this, in order to improve performance and response time.  However, this can wreak havoc - or at least it can be annoying - during page testing, when you need to see “cause and effect” with your changes  To flush individual Page Beans (JSFHandlers) from App-Server memory:  From inside the JSFHandler.egl file  Set focus and press Ctrl/G  To flush all Page Beans from App-Server memory:  From the Servers tab  Right-click and select: Add and Remove Projects  Remove your project, then  Add your project back App-Server CacheMemory …serves… Your.JSP pages EGLJSFHandler EGLJSFHandler EGLJSFHandler

21 Last update: 12/04/2007 Best Practices – “MVC-Like” Software Architecture  By using JSFHandlers as they were meant – for U.I. logic, responding to user-events, managing state and for page navigation – you can architect an 3-tier environment, providing maximum: scalability, flexibility and reuse. AJAX/JavaScript