Facelets Çağatay Çivici Apache MyFaces PMC

Slides:



Advertisements
Similar presentations
Chapter 51 Scripting With JSP Elements JavaServer Pages By Xue Bai.
Advertisements

Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
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.
JavaServer Faces Dr Jim Briggs 1JavaServer Faces.
DT228/3 Web Development JSP: Directives and Scripting elements.
Java Server Pages Russell Beale. What are Java Server Pages? Separates content from presentation Good to use when lots of HTML to be presented to user,
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
Struts 2.0 an Overview ( )
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.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
De-mystifying JavaServer™ Faces
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.
Java Server Faces Çağatay Çivici Apache MyFaces Team Member
Applets & Servlets.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Dynamic Web Sites Chris North cs3724: HCI. Presentations matt ketner, sam altman, mike gordon Vote: UI Hall of Fame/Shame?
SDPL 2002Notes 7: Apache Cocoon1 7 XML Web Site Architecture Example: Apache Cocoon, a Web publishing architecture based on XML technology
1 Introduction to JavaServerFaces & MyFaces Anudeep Jassal.
JavaServer Faces Jeff Schmitt October 5, Introduction to JSF Presents a standard framework for building presentation tiers for web applications.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
Java Server Pages Lecture July Java Server Pages Java Server Pages (JSPs) provide a way to separate the generation of dynamic content (java)
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
CSCI 6962: Server-side Design and Programming Java Server Faces Components and Tags.
Universiti Utara Malaysia Chapter 3 Introduction to ASP.NET 3.5.
Stanisław Osiński, 2002JSP – A technology for serving dynamic web content Java Server Pages™ A technology for serving dynamic web content Stanisław Osiński,
Fall CIS 764 Database Systems Design L8. Web ….
ADVM420- Class #1 Web Design with PHP and MySQL Introduction to PHP © Copyright 2007 Grant Macewan College Micah Slavens -
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
JSP Fundamentals Elements of a JSP Using Beans with JSP Integrating Servlets and JSP.
JAVA SERVER FACES ADITI RAJORIYA UNI – ar2630. POINTS TO BE DISSCUSED WHAT IS JSF? WHY JSF? ARCHITECTURE JSF VERSIONS UI COMPONENTS JSF STRUCTURE AND.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
CSCI 6962: Server-side Design and Programming Java Server Faces Scoping and Session Handling.
REVOLUTION TO NEXT GENERATION Struts2.0 20/02/ Avishek Arang ::
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.
® 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.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
CSCI 6962: Server-side Design and Programming Facelets and User Interface Design.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
1 Web Programming with Servlets & JSP ASSIGNMENT GUIDELINE.
Basic JSP Celsina Bignoli Problems with Servlets Servlets contain –request processing, –business logic –response generation all lumped.
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 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
14 Copyright © 2004, Oracle. All rights reserved. Enhancing the User Interface.
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
JavaServer Faces framework Craig McClanahan is presented that created Struts web framework and based on experience gathered designed JavaServer.
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.
® IBM Software Group © 2003 IBM Corporation IBM WebSphere Studio V5.1.2: Making Java Development Easier May 2004.
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
JSP in Action. JSP Standard Actions forward, include, useBean, setProperty, getProperty, text, element, and plugin Additional actions param, params,
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.
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
World Wide Web has been created to share the text document across the world. In static web pages the requesting user has no ability to interact with the.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Introduction to Java Server Faces (covered topics) ● Reasons to use „Java Server Faces“ ● JSF application structure ● JSF component model ● JSF managed.
1 Facelets Çağatay Çivici Apache MyFaces Team Member Slightly modified by Sang Shin
Intro to JavaServer Faces Mimi Opkins CECS 493 Fall 2016.
Examples with Java Server Faces (covered topics)
JSP (Java Server Page) JSP is server side technology which is used to create dynamic web pages just like Servlet technology. This is mainly used for implementing.
Facelets BY: Tejashri Udavant..
JavaServer Faces: The Fundamentals
The JSF Tools Project – WTP (internal) release review
Presentation transcript:

Facelets Çağatay Çivici Apache MyFaces PMC

Çağatay Çivici  Apache MyFaces Project PMC Member  OpenLogic Expert Group Member  Sourceforge jsf-comp project developer  JSF Client Side Validators  Acegi Security Framework’s JSF Components  JFreeChart for JSF : JSF Chart Creator  FacesTrace: Visual Debugger of JSF

Agenda  JSF and JSP  Facelets  Jsfc and inline texts  Templating  Composition Components  EL Functions  JSTL Support  Custom Logic Tags

JSF and JSP  JSP is the default view technology  JSP tags refer to JSF components h:commandButton = HtmlCommandButton  Mixing them brings overhead because of two different lifecycles

JSF and JSP (Advantages)  JSP is well adopted, reduces learning curve of JSF.  Above is the only advantage

JSF and JSP (Disadvantages)  JSP is created to generate dynamic output not to create component trees  Two different lifecycles (overhead)  Content Interweaving Issues

JSF and JSP  JSF Initial request (e.g. index.jsf) 1.FacesServlet gets the request and JSF lifecycle begins 2.restoreState returns null and a new view is created (createView) with view id = index.jsp (jsp is the default suffix) 3.lifecycle jumps to renderResponse 4.renderView is called that dispatches index.jsp to the container 5.Container traverses all the tags, tags call component’s encode methods during component tree is created 6.State is saved via writeState and buffered output is rendered to the client. JSF a servletwrapper is used instead of f:view to buffer the content and component tree is created before rendering

Facelets  A viewhandler purely created for JSF  No more JSP .xhtml instead of.jsp  No tld files and no tag classes to defined a UIComponent  Faster than using JSP&JSF

Migrating from JSP to Facelets  

Installation  Add jsf-facelets.jar to the classpath  Add viewhandler config to faces-config.xml  Change javax.faces.DEFAULT_SUFFIX to.xhtml

*.taglib.xml  Concept similar to tld but lightweight  Used to define components, converters, validators, composition components, custom logic tags, functions and etc.

Jsfc  Jsfc : jwcid concepty in Tapestry  Provides integration with HTML editors

Inline Texts  Inline Text: Display texts without a UIComponent #{IndexPageBean.welcomeMessage}

Support for Unified EL  Facelets support the Unified EL  #{BeanName.field} same as;  ${BeanName.field}

Templating  A template is an xhtml with placeholders  Placeholders are marked with ui:insert Fragment from Template.xhtml Default Title  In order to use the template ui:composition is needed. Fragment from index.xhtml Welcome to index page

Composition Components  Composition component is basically a template  userInfo.xhtml Logged as : #{user}  myfacelets.taglib.xml userInfo tags/userInfo.xhtml  Use as;

EL Functions  MyFunctions.java public static String length(String name) { if( name == null ) return null; else return String.valueOf( name.length() ); }  myfacelets.taglib.xml length faceletsbox.utils.CustomerUtils java.lang.String length(java.lang.String)  Use as; #{ds:length(MyBean.userName)}

JSTL Support  With JSP, mixing JSF and JSTL is problematic  Facelets brings limited but faultless support

Custom logic tags  JSTL like logic tags by extending Facelets TagHandler  myfacelets.taglib.xml if mycompany.myproject.utils.IfHandler  Use as; Welcome

List of built-in Facelets tags 

Summary  Facelets saves JSF from the burden of JSP  Great for templating and composition components plus bonuses like el functions  IDE support is not wide, only Exadel support facelets for now

The End – Questions?  