Pittsburgh Java User Group– Dec 9 2009 Java PureFaces: A JSF Framework Extension.

Slides:



Advertisements
Similar presentations
Apache Struts Technology
Advertisements

 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
© 2007 IBM Corporation IBM Emerging Technologies Enabling an Accessible Web 2.0 Becky Gibson Web Accessibility Architect.
Google Web Toolkit - Gufran Mohammed. Google Web Toolkit (GWT) is an open source Java software development framework that makes writing AJAX applications.
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
DT228/3 Web Development JSP: Directives and Scripting elements.
Microsoft ASP.NET AJAX - AJAX as it has to be Presented by : Rana Vijayasimha Nalla CSCE Grad Student.
Java Server Faces Model/View/Controller Design Pattern for Web Development Slides adapted from “Core JavaServer Faces” by Geary and Horstmann and the J2EE.
{ Apache - Click By, By, Anupam Mundale. Anupam Mundale. Viraj Kulkarni. Viraj Kulkarni.
Apache Struts Technology A MVC Framework for Java Web Applications.
Session-01. Layers Struts 2 Framework The struts 2 framework is used to develop MVC-based web application. Struts 1.0 was released in June The.
UNIT-V The MVC architecture and Struts Framework.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
JQuery CS 268. What is jQuery? From their web site:
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
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.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
JavaScript & jQuery the missing manual Chapter 11
Joel Bapaga on Web Design Strategies Technologies Commercial Value.
MAVEN-BLUEMARTINI Yannick Robin. What is maven-bluemartini?  maven-bluemartini is Maven archetypes for Blue Martini projects  Open source project on.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
AJAX Without the “J” George Lawniczak. What is Ajax?
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
JBoss Developer Studio. JBoss Developer Studio provides a certified open source development environment that includes and integrates: Eclipse Eclipse.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Google Web Toolkit An Overview By Shauvik Roy Choudhary.
CHEF II / Sakai Architecture. CHEF II Changes uPortal replaces Jetspeed –jsr 168 portlet, servlet compliant Spring replaces Turbine component framework.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Fall CIS 764 Database Systems Design L8. Web ….
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
Introduction to Web Dimitar Nenchev Ivan Nakov
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
WEP Presentation for non-IT Steps and roles in software development 2. Skills developed in 1 st year 3. What can do a student in 1 st internship.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
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.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
Reading Flash. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also choose some.
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.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
Java Servlets and Java Server Pages
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
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.
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.
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.
Apache Struts Technology A MVC Framework for Java Web Applications.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Struts 2 Development. Topics  Roles in Struts Development  Control Flow  Actions  Struts 2 Views and Target  Struts 2 Custom Tags  Validation 
Section 10.1 Define scripting
Google Web Toolkit Tutorial
Google Web Toolkit - Gufran Mohammed
Top Reasons to Choose Angular. Angular is well known for developing robust and adaptable Single Page Applications (SPA). The Application structure is.
JavaServer Faces: The Fundamentals
Bootstrap Direct quote from source: bootstrap/
Presentation transcript:

Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension

 Web development and JSF review  Java PureFaces - a JSF extension  Briefly discuss current state of the project  Q&A

 First, static web content  Written in HTML  Sent directly to the browser  Next, dynamic web content  Web containers, Java servlets, JSP  HTML is dynamically generated and then sent to browser Web Development

 JSP - Java Server Pages  UI code writing in JSP and on the server  Difficult to maintain  Not a programming language  Attempts to solve JSP downfalls – new frameworks  Struts, Tapestry, WebObjects, Spring MVC, JSF, Wicket, GWT, etc.  Try to solve issues such as error handling, validation, code reuse, etc.  Use tags to bind data to the server  Wicket and GWT provide Java solutions Web Development Java is the way to go.

 What is it?  A server side user interface component framework for Java™ technology-based web applications – wikipedia  A specification and reference implementation for a web application development framework containing components, events, validators & converters, navigation, etc. – wikipedia  Developed by SUN and part of the J2EE SPEC!  Uses static template pages (containing mix of JSF special tags and HTML tags)  Uses “backing-bean” on the server side for binding. Ex: #{address.city}  Navigation & backing-beans are defined in static files Quick JSF Overview

What JSF looks like.. JSP Page Backing Bean faces-config.xml

It can get very big quickly. (Each thing needs to be set up for each view) You can see the JSF GuessNumber demo herehere

But… JSF supports UI Component creation through Java. Ex:

 An extension of JSF.  Uses standard JSF and RichFaces to create PureFaces components  All UI development is in Java  CSS and JavaScript are easy to plug-in  Can be added to an existing application  Add a purefaces bean in the configuration file and easily bind into existing pages using :  Simple API.  new PureOutput(“Hello World”); What is Java PureFaces?

Java PureFaces vs. JSF Very simple. …and the JSP page and simple bean only need to be defined once at the beginning of the project. Source code available at

Java Purefaces components PureFaces online component demo The demo source is available at To run it locally, unzip it and run “ mvn tomcat:run”. Get maven herehere

 Direct wrappers of existing JSF components  Encapsulation of the JSF components has advantages:  Simplifies the API for the developer  PureComponents are serializable  Creating Custom components is simplified  Components can quickly be created in PureFaces – no tags or configuration  Application-specific components are POJO PureComponents To create a component or whole view, just implement PureComponent

Custom components public class LabelAndInputComponent implements PureComponent { private String label; private PureEditableValue editableValue; public LabelAndInputComponent(String label, E value) { this.label = label; this.editableValue = new PureEditableValue (value); } public PureComponent createUIComponent() { PurePanelGrid grid= new PurePanelGrid(2); grid.add(new PureOutput(label).setStyleClass("labelStyleClass")); grid.add(new PureInput(editableValue).setStyleClass("inputStyleClass")); return grid; } public E getValue(){ return editableValue.getValue(); } }

Custom components private LabelAndInputComponent field = new LabelAndInputComponent ("A Label", "default text"); // example /** Create a DIV element that contains a label component */ public PureComponent createUIComponent() { PureDiv div = new PureDiv(); div.setStyleClass("divStyleClass"); div.add(field); return div; } // ex: get the value from the field now using field.getValue(); Source code from PureFaces article on The Server SideThe Server Side

 Simplified with maintenance in mind: 80% of your cost  Simple: Straightforward SWING-like API (without having to have a member for each UI component)  Single UI Location : Changing the UI can be done in one place. There is no need to keep a JSP page in-sync with its bean.  Easy refactoring: Everything is in Java. Use of existing, robust refactoring tools makes it easy.  Testing: All bindings can be tested by creating the component or view in a simple JUNIT test. Java PureFaces features

 Ajax-enabled  Built-in by using RichFace  PureFaces API includes methods for adding Ajax  CSS & JavaScript  PureFaces makes it easy to use semantic HTML and add CSS / JS  RichFaces jQuery component makes it easy to target complex JSF component elements by adding scripts only where necessary (no additional JS files to load). Java PureFaces features PureFaces Demo Link

 Binding attributes to any object  Get around using backing beans by using the JSF ValueChangeListener to go back into the application and set up values when the form is submitted  We created a class called InputValueChangeListener to set these values like this: PropertyUtils.setNestedProperty(obj, attribute, changeEvent.getNewValue());  Bindings are tested when the object is created, so they can be tested with JUNIT Under the hood... PureFaces Demo Link

 Binding buttons and links to any objects  Get around backing beans by using JSF ActionListeners  We created an ActionListener called CommandActionListener to execute Runnable s, and a Runnable named MethodCommand to execute a method in an object. MethodCommand does this using reflection: runningClass.getDeclaredMethod(methodName, classes).invoke(obj, args);  Bindings are tested when the object is created, so they can be tested with JUNIT Under the hood... PureFaces Demo Link

 Creating a new UI on Ajax event  We add an ActionListener to the RichFaces AjaxSupport component.  We then use a Runnable to update the JSF component tree with whatever is configured to be updated on a specific ajax-event. Under the hood... PureFaces Demo Link

 UI with Java PureFaces in practice  Start with the interface requirements  Design the behavior of the implementation (standard OO design)  Break up the view per the application design  Create any new components or custom application components  Add basic CSS, and jQuery to target HTML only accessible after HTML is created  Use firebug in FireFox to tweak and get the final CSS, & test in all browsers (and most likely fix some IE compatibility issues)  Tools  Eclipse: for just about everything. In debug mode, changes are immediately available without reloading app  Browser tools: firebug in FireFox, developer tools in IE8 and Chrome. IETester for previous versions of IE. Also, Web Developer in FireFox has some nice features  AjaxLog: component included in RichFaces to help debug any ajax interactions not working as expected UI design

 Virtually all development is in Java  There is a single JSP page and a simple bean to connect it to the application  All PureComponents are POJO.  Extremely dynamic  Views are created directly from the application and can easily be redefined on the fly (ex: panelGrid demo)  Direct object-model access  No need to worry about what is accessible only through the bean  Simpler maintenance, Faster development  Views can be tested through JUnit.  Everything can be done using Java tools (refactoring, etc.)  Simpler, documented API  Ajax- enabled To summarize...

 Component development  Need to implement more components. Built on as-needed basis  Depends on Session to store the UI  Combines aspects of UI Development with Java Developer role  many JSF developers handle both Current state

 We are trying to raise awareness in the community so that:  We can get outside opinions and suggestions  Others can help expand and grow the framework extension.  There is more information available:    Source code at  Demo available at What’s next?

Want more information?

 XML was not designed to be edited by humans… and we don’t like editing HTML or JSP (JavaServer Pages) either.  We wanted something more dynamic for web application development!  Web applications using JSP pages can quickly become huge and difficult to maintain.  We have such nice tools for developing Java already. Java PureFaces – why?