Facelets BY: Tejashri Udavant..

Slides:



Advertisements
Similar presentations
Facelets Çağatay Çivici Apache MyFaces PMC
Advertisements

Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Introduction to Java Server Faces Aaron Zeckoski
Web applications using JavaServer Faces (JSF) A brief introduction 1JavaServer Faces (JSF)
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.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
UNIT-V The MVC architecture and Struts Framework.
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 Pages CS-422. What are JSPs A logical evolution of java servlets –most servlets dynamically create HTML and integrate it with some computational.
Java Server Faces Çağatay Çivici Apache MyFaces Team Member
Intermediate JSP Matt Wheeler. Notes This is a training NOT a presentation If you have questions please ask them Prerequisites – Introduction to Java.
Java for the WWW November 2012Slide Tag Libraries What are they? –Custom libraries Custom tags – see examples in following slides.
1 Web Technologies in Java EE6 : Servlet 3.0 & JSF 2.0 What's New ? Rohit Kelapure, IBM 11/5/2011.
Chapter 11 © 2014 by Pearson Education Introduction to Servlets - A servlet is a Java object that responds to HTTP requests and is executed on a.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
® IBM Software Group © 2007 IBM Corporation JSP Custom Tags
Chapter 7 Java Server Pages. Objectives Explain how the separation of concerns principle applies to JSP Describe the operation and life-cycle of a JSP.
JSF road map (NI) Clientside validation Show problems
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
CSCI 6962: Server-side Design and Programming Java Server Faces Components and Tags.
Struts2 Plugin Development - Extending Struts2 Justin Yip.
® IBM Software Group © 2007 IBM Corporation JSP Expression Language
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,
JSTL Lec Umair©2006, All rights reserved JSTL (ni) Acronym of  JavaServer Pages Standard Tag Library JSTL (like JSP) is a specification, not an.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
Chapter 7 Using Custom Tag Libraries and the JSP Standard Tag Library.
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)
CS320 Web and Internet Programming Custom Tag Library Chengyu Sun California State University, Los Angeles.
PageDesigner Introduction Sybase, Inc.. Features WYSIWYG web page editor for HTML/CSS/JSP/JSF pages Full HTML4.0, CSS2 support Design, Source and preview.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
CSCI 6962: Server-side Design and Programming Facelets and User Interface Design.
1 Web Programming with Servlets & JSP ASSIGNMENT GUIDELINE.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
10 When even JSTL is not enough: custom tag development Sometimes JSTL and standard actions aren’t enough. When you need something custom, and you don’t.
Intermediate JSP Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic Java.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
® IBM Software Group © 2007 IBM Corporation JSP Tag Files
CS320 Web and Internet Programming Custom Tag Library Chengyu Sun California State University, Los Angeles.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Comparative Display Technologies.
Struts 2 Development. Topics  Roles in Struts Development  Control Flow  Actions  Struts 2 Views and Target  Struts 2 Custom Tags  Validation 
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
Facelets Mimi Opkins CECS493 Fall Facelets  User interfaces are typically a web application’s most volatile aspect during development, and they.
Intro to JavaServer Faces Mimi Opkins CECS 493 Fall 2016.
Creative Commons Attribution- ShareAlike 2.5 License Sakai Programmer's Café Sakai Oxford Tetra ELF Workshop Comparative Display Technologies in Sakai.
Examples with Java Server Faces (covered topics)
11.1 Introduction to Servlets
JSF – A Simple Example Mimi Opkins CECS 493 Fall 2016.
CS3220 Web and Internet Programming Custom Tag Library
JSP: Actions elements and JSTL
Copyright © Liferay, Inc.
COMP9321 Web Application Engineering Semester 2, 2017
Chapter 44 JavaServer Face
IS-907 Java EE Templating.
Unit 6-Chapter 2 Struts.
JSF Portlet Navigation and Event Listeners
JSF Portlet Message Bundles
Chapter 39 JavaServer Face
JavaServer Faces: The Fundamentals
The JSF Tools Project – WTP (internal) release review
JavaServer Faces: It is a server side component based user interface framework. It is used to develop web applications. It provides a well-defined programming.
Struts BY: Tejashri Udavant..
Presentation transcript:

Facelets BY: Tejashri Udavant.

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 <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">

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 <h:commandButton id=“btn_save” value=“Save” action=“#{bean.method}” /> <input jsfc="h:commandButton" type="submit" id=“btn_save" value=“Save“ action=“#{bean.method}”/> Provides integration with HTML editors

Inline Texts Inline Text: Display texts without a UIComponent <h:outputText value=“#{IndexPageBean.welcomeMessage}” /> <h1>#{IndexPageBean.welcomeMessage}</h1>

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 <title> <ui:insert name="title">Default Title</ui:insert> </title> In order to use the template ui:composition is needed. Fragment from index.xhtml <ui:composition template="/template.xhtml"> <ui:define name="title"> Welcome to index page </ui:define>

Composition Components Composition component is basically a template userInfo.xhtml <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"> <h3>Logged as : #{user}</h3> </ui:composition> myfacelets.taglib.xml <tag> <tag-name>userInfo</tag-name> <source>tags/userInfo.xhtml</source> </tag> Use as; <ds:userInfo user="#{myBean.currentUser}"/>

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

JSTL Support With JSP, mixing JSF and JSTL is problematic Facelets brings limited but faultless support <c:if> <c:forEach> <c:catch> <c:set>

Custom logic tags JSTL like logic tags by extending Facelets TagHandler myfacelets.taglib.xml <tag> <tag-name>if</tag-name> <handler-class>mycompany.myproject.utils.IfHandler</handler-class> </tag> Use as; <ds:if test="#{MyBean.isLoggedIn}"> Welcome </ds:if>

List of built-in Facelets tags <ui:component/> <ui:composition/>  <ui:debug/>  <ui:decorate/> <ui:define/> <ui:fragment/> <ui:include/> <ui:insert/> <ui:param/> <ui:remove/> <ui:repeat/>