SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
Facelets	
  
Diego	
  Armando	
  Gómez	
  M	
  
dgomez@vortexbird.com	
  
	
  
Introducción	
  
•  JavaServer	
   Facelets	
   es	
   un	
   framework	
   para	
  
plan5llas	
   (templates)	
   centrado	
   en	
   la	
  
tecnología	
  JSF	
  (JavaServer	
  Faces),	
  por	
  lo	
  cual	
  
se	
  integran	
  de	
  manera	
  muy	
  fácil.	
  
Introducción	
  
•  Caracterís5cas	
  :	
  
–  Tiempo	
  de	
  desarrollo	
  cero	
  de	
  tags	
  para	
  UIComponents.	
  
–  Facilidad	
  en	
  la	
  creación	
  del	
  templa5ng	
  para	
  los	
  
componentes	
  y	
  páginas.	
  
–  Es	
  posible	
  separar	
  los	
  UIComponents	
  en	
  diferentes	
  
archivos.	
  
–  Soporte	
  completo	
  a	
  EL	
  (Expression	
  Language).	
  
–  No	
  es	
  necesaria	
  configuración	
  XML.	
  
–  Trabaja	
  con	
  cualquier	
  RenderKit.	
  
Porque	
  usar	
  Facelets	
  
•  Independiente	
  del	
  contenedor	
  Web	
  (Tomcat,	
  JeTy,	
  GlassFish,	
  Jboss,	
  etc)	
  
•  Facelets	
  provee	
  un	
  proceso	
  de	
  compilación	
  más	
  rápido	
  que	
  JSP.	
  
•  Provee	
  templa5ng,	
  lo	
  cual	
  implica	
  reu5lización	
  de	
  código,	
  simplificación	
  
de	
  desarrollo	
  y	
  facilidad	
  en	
  el	
  mantenimiento	
  de	
  grandes	
  aplicaciones.	
  
•  Permite	
  crear	
  componentes	
  ligeros	
  sin	
  necesidad	
  de	
  crear	
  los	
  tags	
  de	
  los	
  
UIComponents	
  (es	
  más	
  fácil	
  comparado	
  a	
  crear	
  un	
  componente	
  JSF	
  puro).	
  
•  Soporta	
  Unified	
  Expression	
  Language,	
  incluyendo	
  soporte	
  para	
  funciones	
  
EL	
  y	
  validación	
  de	
  EL	
  en	
  5empo	
  de	
  compilación.	
  
•  Es	
  posible	
  conver5r	
  template	
  en	
  HTML5	
  fácilmente.	
  
•  En	
  Facelets,	
  las	
  páginas	
  son	
  XTHML	
  
•  Facelets	
  permite	
  incluir	
  texto,	
  e5quetas	
  y	
  expresiones	
  en	
  cualquier	
  zona	
  
de	
  la	
  página,	
  y	
  se	
  encargará	
  de	
  evaluarlo.	
  
Configuración	
  Maven	
  
•  Solo	
  se	
  debe	
  descargar	
  el	
  jar	
  de	
  primefaces-­‐
{version}.jar	
  y	
  la	
  impelemtacion	
  de	
  referencia	
  
de	
  jsf,	
  en	
  este	
  caso	
  mojarra	
  2.2.9	
  
Maven	
  
<!-­‐-­‐	
  Primefaces	
  -­‐-­‐>	
  
	
   	
  <dependency>	
  
	
   	
   	
  <groupId>org.primefaces</groupId>	
  
	
   	
   	
  <ar9factId>primefaces</ar9factId>	
  
	
   	
   	
  <version>5.1</version>	
  
	
   	
  </dependency>	
  
	
   	
  <!-­‐-­‐	
  Primefaces	
  à 	
   	
  	
  
	
   	
  <dependency>	
  
	
   	
   	
  <groupId>org.glassfish</groupId>	
  
	
   	
   	
  <ar9factId>javax.faces</ar9factId>	
  
	
   	
   	
  <version>2.2.9</version>	
  
	
   	
  </dependency>	
  
Configuración	
  web.xml	
  
<?xml	
  version="1.0"	
  encoding="UTF-­‐8"?>	
  
<web-­‐app	
  version="3.0"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  xmlns="hNp://java.sun.com/xml/ns/javaee"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  xmlns:xsi=hNp://www.w3.org/2001/XMLSchema-­‐instance	
  	
  xsi:schemaLoca9on="hNp://java.sun.com/xml/ns/javaee	
  hNp://
java.sun.com/xml/ns/javaee/web-­‐app_3_0.xsd"	
  >	
  
	
  	
  	
  	
  <display-­‐name>demoFacelets</display-­‐name>	
  
	
  	
  <welcome-­‐file-­‐list>	
  
	
  	
  	
  	
  <welcome-­‐file>index.xhtml</welcome-­‐file>	
  
	
  	
  </welcome-­‐file-­‐list>	
  
	
  	
  <servlet>	
  
	
  	
  	
  	
  <servlet-­‐name>Faces	
  Servlet</servlet-­‐name>	
  
	
  	
  	
  	
  <servlet-­‐class>javax.faces.webapp.FacesServlet</servlet-­‐class>	
  
	
  	
  	
  	
  <load-­‐on-­‐startup>1</load-­‐on-­‐startup>	
  
	
  	
  </servlet>	
  
	
  	
  <servlet-­‐mapping>	
  
	
  	
  	
  	
  <servlet-­‐name>Faces	
  Servlet</servlet-­‐name>	
  
	
  	
  	
  	
  <url-­‐paTern>/faces/*</url-­‐paTern>	
  
	
  	
  </servlet-­‐mapping>	
  	
  	
  
	
  	
  <servlet-­‐mapping>	
  
	
  	
  	
  	
  <servlet-­‐name>Faces	
  Servlet</servlet-­‐name>	
  
	
  	
  	
  	
  <url-­‐paTern>*.xhtml</url-­‐paTern>	
  
	
  	
  </servlet-­‐mapping>	
  
</web-­‐app>	
  
header.xhtml	
  
<jsp:root	
  jsfc="f:view"	
  xmlns:jsp="hNp://java.sun.com/JSP/Page"	
  
	
  	
  	
  	
  xmlns:f="hNp://java.sun.com/jsf/core"	
  
	
  	
  	
  	
  xmlns:h="hNp://java.sun.com/jsf/html"	
  
	
  	
  	
  	
  xmlns:ui="hNp://java.sun.com/jsf/facelets"	
  
	
  	
  	
  	
  xmlns:c="hNp://java.sun.com/jstl/core"	
  
	
  	
  	
  	
  xmlns:p="hNp://primefaces.org/ui"	
  
	
  	
  	
  	
  xmlns:fn="hNp://java.sun.com/jsp/jstl/func9ons">	
  
	
  	
  	
  
	
  	
  	
  <html>	
  
	
   	
  <body>	
  
	
   	
   	
  <f:view>	
  
	
   	
   	
   	
  <ui:composi9on> 	
   	
   	
   	
   	
  	
  
	
   	
   	
   	
   	
  	
  	
  	
  	
  	
  	
  	
  	
  <h1>El	
  encabezado	
  de	
  mi	
  si9o	
  Web</h1>	
  
	
   	
   	
   	
   	
  	
  	
  	
  	
  	
  	
  	
  	
  <p>Esto	
  es	
  un	
  template	
  con	
  facelets</p>	
  
	
   	
   	
   	
  </ui:composi9on>	
  
	
   	
   	
  </f:view>	
  
	
   	
  </body>	
  
	
  </html>	
  
</jsp:root>	
  
footer.xhtml	
  
<jsp:root	
  jsfc="f:view"	
  xmlns:jsp="hNp://java.sun.com/JSP/Page"	
  
	
  xmlns:f="hNp://java.sun.com/jsf/core"	
  
	
  xmlns:h="hNp://java.sun.com/jsf/html"	
  
	
  xmlns:ui="hNp://java.sun.com/jsf/facelets"	
  
	
  xmlns:c="hNp://java.sun.com/jstl/core"	
  
	
  xmlns:fn="hNp://java.sun.com/jsp/jstl/func9ons">	
  
	
  <html>	
  
	
   	
  <body>	
  
	
   	
   	
  <f:view>	
  
	
   	
   	
   	
  <ui:composi9on> 	
   	
   	
   	
  	
  
	
   	
   	
   	
   	
   	
  <h3>Esta	
  es	
  la	
  parte	
  inferior</h3> 	
   	
   	
  	
  
	
   	
   	
   	
  </ui:composi9on>	
  
	
   	
   	
  </f:view>	
  
	
   	
  </body>	
  
	
  </html>	
  
</jsp:root>	
  
template.xhtml	
  
<html	
  xmlns="hNp://www.w3.org/1999/xhtml"	
  
	
  xmlns:h="hNp://java.sun.com/jsf/html"	
  
	
  xmlns:ui="hNp://java.sun.com/jsf/facelets">	
  
	
  	
  <h:head>	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  <5tle>.::Titulo	
  de	
  mi	
  app	
  web::.</5tle>	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  </h:head> 	
  	
  
	
  <h:body> 	
   	
  	
  
	
   	
   	
  <ui:insert	
  name="header">	
  
	
   	
   	
   	
  	
  <ui:include	
  src="/WEB-­‐INF/facelets/header.xhtml"	
  />	
  
	
   	
   	
  </ui:insert>	
  
	
   	
  	
  
	
   	
   	
   	
  <ui:insert	
  name="body"/>	
  
	
   	
  	
  
	
   	
   	
  <ui:insert	
  name="footer">	
  
	
   	
   	
   	
  	
  <ui:include	
  src="/WEB-­‐INF/facelets/footer.xhtml"	
  />	
  
	
   	
   	
  </ui:insert> 	
   	
  	
  
	
  </h:body>	
  
</html>	
  
index.xhtml	
  
<html	
  xmlns="hNp://www.w3.org/1999/xhtml"	
  
	
  xmlns:h="hNp://java.sun.com/jsf/html"	
  
	
  xmlns:p="hNp://primefaces.org/ui"	
  
	
  xmlns:f="hNp://java.sun.com/jsf/core"	
  
	
  xmlns:ui="hNp://java.sun.com/jsf/facelets">	
  
	
  	
  
	
  <h:head>	
  
	
   	
  <meta	
  hTp-­‐equiv="Content-­‐Type"	
  content="text/html;	
  charset=UTF-­‐8"/>	
  
	
  </h:head>	
   	
  	
  
	
  	
  
	
  <h:body>	
  
	
   	
  <ui:composi5on	
  template="/WEB-­‐INF/facelets/template.xhtml"> 	
  	
  
	
   	
   	
  <ui:define	
  name="body"> 	
  	
  
	
   	
   	
   	
  <f:view>	
  
	
   	
   	
   	
   	
  <p:keyboard	
  id="default"	
  />	
  
	
   	
   	
   	
  </f:view>	
  
	
   	
   	
  </ui:define> 	
   	
  	
  
	
   	
  </ui:composi5on> 	
  	
  
	
  </h:body>	
  	
  
</html> 	
  	
  
Enlaces	
  
•  hTp://docs.oracle.com/javaee/6/tutorial/doc/
gijtu.html	
  
•  hTp://www.mkyong.com/jsf2/jsf-­‐2-­‐
templa5ng-­‐with-­‐facelets-­‐example/	
  
Información	
  de	
  contacto	
  
•  Si5o	
  Web:	
  www.vortexbird.com	
  
•  Blog:	
  hTp://blog.vortexbird.com	
  
•  Zathuracode:	
  www.zathuracode.org	
  
•  Contacto	
  vía	
  mail:	
  dgomez@vortexbird.com	
  
•  Teléfonos:	
  +57	
  	
  -­‐	
  (316	
  482	
  4629)	
  
Facelets

Weitere ähnliche Inhalte

Was ist angesagt?

PowerShell para administradores
PowerShell para administradoresPowerShell para administradores
PowerShell para administradores
Pablo Campos
 

Was ist angesagt? (20)

Asp
AspAsp
Asp
 
Asp .net
Asp .netAsp .net
Asp .net
 
SEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVC
SEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVCSEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVC
SEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVC
 
Como hacer de todo con PowerShell
Como hacer de todo con PowerShellComo hacer de todo con PowerShell
Como hacer de todo con PowerShell
 
PowerShell para administradores
PowerShell para administradoresPowerShell para administradores
PowerShell para administradores
 
Presentacion sobre asp
Presentacion sobre aspPresentacion sobre asp
Presentacion sobre asp
 
Rest
RestRest
Rest
 
Introducción a REST - SymfonyVLC
Introducción a REST - SymfonyVLCIntroducción a REST - SymfonyVLC
Introducción a REST - SymfonyVLC
 
Herramientas Java
Herramientas JavaHerramientas Java
Herramientas Java
 
Dreamweaver
DreamweaverDreamweaver
Dreamweaver
 
Web services y java
Web services y javaWeb services y java
Web services y java
 
Desarrollando Una Mejor Experiencia De Usuario Con Ajax
Desarrollando Una Mejor Experiencia De Usuario Con AjaxDesarrollando Una Mejor Experiencia De Usuario Con Ajax
Desarrollando Una Mejor Experiencia De Usuario Con Ajax
 
Introducción a Laravel 5 - Un Framework para Artesanos Web
Introducción a Laravel 5 - Un Framework para Artesanos WebIntroducción a Laravel 5 - Un Framework para Artesanos Web
Introducción a Laravel 5 - Un Framework para Artesanos Web
 
deSymfony 2013 - Creando aplicaciones web desde otro ángulo con Symfony y A...
deSymfony 2013 -  Creando aplicaciones web desde otro ángulo con Symfony y A...deSymfony 2013 -  Creando aplicaciones web desde otro ángulo con Symfony y A...
deSymfony 2013 - Creando aplicaciones web desde otro ángulo con Symfony y A...
 
STRUTS (MVC e Java)
STRUTS (MVC e Java)STRUTS (MVC e Java)
STRUTS (MVC e Java)
 
Javaserver Faces (jsf)
Javaserver Faces (jsf)Javaserver Faces (jsf)
Javaserver Faces (jsf)
 
Windows PowerShell para Desarrolladores SharePoint | SolidQ Summit 2012
Windows PowerShell para Desarrolladores SharePoint | SolidQ Summit 2012Windows PowerShell para Desarrolladores SharePoint | SolidQ Summit 2012
Windows PowerShell para Desarrolladores SharePoint | SolidQ Summit 2012
 
Symfony en Drupal 8 - DrupalCamp Spain
Symfony en Drupal 8 - DrupalCamp Spain Symfony en Drupal 8 - DrupalCamp Spain
Symfony en Drupal 8 - DrupalCamp Spain
 
4. Curso Java JSP (Java Server Pages) - Curso 2005-2006
4. Curso Java JSP (Java Server Pages) - Curso 2005-20064. Curso Java JSP (Java Server Pages) - Curso 2005-2006
4. Curso Java JSP (Java Server Pages) - Curso 2005-2006
 
Web Services JAX-RS RESTful y SOAP
Web Services JAX-RS RESTful y SOAPWeb Services JAX-RS RESTful y SOAP
Web Services JAX-RS RESTful y SOAP
 

Andere mochten auch (8)

Presentación de MaterializeCSS
Presentación de MaterializeCSSPresentación de MaterializeCSS
Presentación de MaterializeCSS
 
Material design aplicado a la web
Material design aplicado a la webMaterial design aplicado a la web
Material design aplicado a la web
 
09b jsf (1)
09b jsf (1)09b jsf (1)
09b jsf (1)
 
Ejercicio basico jsf’s
Ejercicio basico jsf’sEjercicio basico jsf’s
Ejercicio basico jsf’s
 
06. jsf (java server faces) (1)
06. jsf (java server faces) (1)06. jsf (java server faces) (1)
06. jsf (java server faces) (1)
 
Manual Jsf
Manual JsfManual Jsf
Manual Jsf
 
Etiquetas básicas jsf
Etiquetas básicas jsfEtiquetas básicas jsf
Etiquetas básicas jsf
 
Metodos para comprobar numeros aleatorios
Metodos para comprobar numeros aleatoriosMetodos para comprobar numeros aleatorios
Metodos para comprobar numeros aleatorios
 

Ähnlich wie Facelets

Apache click
Apache clickApache click
Apache click
ntomasto
 
Jsf Java Server Faces
Jsf   Java Server FacesJsf   Java Server Faces
Jsf Java Server Faces
cok12v
 
9 tecnologías v1.1
9 tecnologías v1.19 tecnologías v1.1
9 tecnologías v1.1
UTN
 
Mootools Y Otros Frameworks JS
Mootools Y Otros Frameworks JSMootools Y Otros Frameworks JS
Mootools Y Otros Frameworks JS
Ian Monge Pérez
 
Introducción a Foundation 5
Introducción a Foundation 5Introducción a Foundation 5
Introducción a Foundation 5
Cycle-IT
 
Desarrollo Aplicaciones Zend Framework
Desarrollo Aplicaciones Zend FrameworkDesarrollo Aplicaciones Zend Framework
Desarrollo Aplicaciones Zend Framework
ricsoc
 
Presentación extensiones interesantes joomla
Presentación extensiones interesantes joomlaPresentación extensiones interesantes joomla
Presentación extensiones interesantes joomla
MadBlake
 

Ähnlich wie Facelets (20)

Taller integracion jsf spring
Taller integracion jsf springTaller integracion jsf spring
Taller integracion jsf spring
 
Apache click
Apache clickApache click
Apache click
 
Jsf
JsfJsf
Jsf
 
15a. Reunion de SpringHispano.org y grails.org.mx
15a. Reunion de SpringHispano.org y grails.org.mx15a. Reunion de SpringHispano.org y grails.org.mx
15a. Reunion de SpringHispano.org y grails.org.mx
 
DISEÑO DE APLICACIONES WEB (INTRODUCCION)
DISEÑO DE APLICACIONES WEB (INTRODUCCION)DISEÑO DE APLICACIONES WEB (INTRODUCCION)
DISEÑO DE APLICACIONES WEB (INTRODUCCION)
 
Intro jsf
Intro jsfIntro jsf
Intro jsf
 
Jsf Java Server Faces
Jsf   Java Server FacesJsf   Java Server Faces
Jsf Java Server Faces
 
9 tecnologías v1.1
9 tecnologías v1.19 tecnologías v1.1
9 tecnologías v1.1
 
Introducción a Flask
Introducción a FlaskIntroducción a Flask
Introducción a Flask
 
De HTML a Express
De HTML a ExpressDe HTML a Express
De HTML a Express
 
Mootools Y Otros Frameworks JS
Mootools Y Otros Frameworks JSMootools Y Otros Frameworks JS
Mootools Y Otros Frameworks JS
 
JqueryMobile
JqueryMobile JqueryMobile
JqueryMobile
 
Phonegap
PhonegapPhonegap
Phonegap
 
JoomlaDay Sevilla 2015 - Desarrollo de plantillas Joomla!
JoomlaDay Sevilla 2015 - Desarrollo de plantillas Joomla!JoomlaDay Sevilla 2015 - Desarrollo de plantillas Joomla!
JoomlaDay Sevilla 2015 - Desarrollo de plantillas Joomla!
 
Introducción a Foundation 5
Introducción a Foundation 5Introducción a Foundation 5
Introducción a Foundation 5
 
Introducción a Foundation 5
Introducción a Foundation 5Introducción a Foundation 5
Introducción a Foundation 5
 
Bootstrap, un framework CSS
Bootstrap, un framework CSSBootstrap, un framework CSS
Bootstrap, un framework CSS
 
Video
VideoVideo
Video
 
Desarrollo Aplicaciones Zend Framework
Desarrollo Aplicaciones Zend FrameworkDesarrollo Aplicaciones Zend Framework
Desarrollo Aplicaciones Zend Framework
 
Presentación extensiones interesantes joomla
Presentación extensiones interesantes joomlaPresentación extensiones interesantes joomla
Presentación extensiones interesantes joomla
 

Mehr von Vortexbird

Introducccion springframework
Introducccion springframeworkIntroducccion springframework
Introducccion springframework
Vortexbird
 

Mehr von Vortexbird (11)

Spring security 2017
Spring security 2017Spring security 2017
Spring security 2017
 
Spring ORM JPA
Spring ORM JPASpring ORM JPA
Spring ORM JPA
 
Spring framework core 2017
Spring framework core 2017Spring framework core 2017
Spring framework core 2017
 
Bean validation 2017
Bean validation 2017Bean validation 2017
Bean validation 2017
 
Introduccion a JPA
Introduccion a JPAIntroduccion a JPA
Introduccion a JPA
 
Log en Aplicaciones Java y JavaEE
Log en Aplicaciones Java y JavaEELog en Aplicaciones Java y JavaEE
Log en Aplicaciones Java y JavaEE
 
Vb.pd.zathuracode.v5.0.1
Vb.pd.zathuracode.v5.0.1Vb.pd.zathuracode.v5.0.1
Vb.pd.zathuracode.v5.0.1
 
Zathuracode Version 5.0.0
Zathuracode Version 5.0.0Zathuracode Version 5.0.0
Zathuracode Version 5.0.0
 
Web services SOAP con JAX-WS
Web services SOAP con JAX-WSWeb services SOAP con JAX-WS
Web services SOAP con JAX-WS
 
Orm hibernate springframework
Orm hibernate springframeworkOrm hibernate springframework
Orm hibernate springframework
 
Introducccion springframework
Introducccion springframeworkIntroducccion springframework
Introducccion springframework
 

Kürzlich hochgeladen

TECNOLOGÍA DE LA INFORMACIÓN SLIDESHARE INVESTIGACION.pdf
TECNOLOGÍA DE LA INFORMACIÓN SLIDESHARE INVESTIGACION.pdfTECNOLOGÍA DE LA INFORMACIÓN SLIDESHARE INVESTIGACION.pdf
TECNOLOGÍA DE LA INFORMACIÓN SLIDESHARE INVESTIGACION.pdf
UPSE
 
TECNOLOGIA DE LA INFORMACION Y MULTIMEDIA 15 MAYO.pptx
TECNOLOGIA DE LA INFORMACION Y MULTIMEDIA 15 MAYO.pptxTECNOLOGIA DE LA INFORMACION Y MULTIMEDIA 15 MAYO.pptx
TECNOLOGIA DE LA INFORMACION Y MULTIMEDIA 15 MAYO.pptx
UPSE
 

Kürzlich hochgeladen (9)

TECNOLOGÍA DE LA INFORMACIÓN SLIDESHARE INVESTIGACION.pdf
TECNOLOGÍA DE LA INFORMACIÓN SLIDESHARE INVESTIGACION.pdfTECNOLOGÍA DE LA INFORMACIÓN SLIDESHARE INVESTIGACION.pdf
TECNOLOGÍA DE LA INFORMACIÓN SLIDESHARE INVESTIGACION.pdf
 
serenidad APP presentacion.pdfes una innovadora aplicación móvil diseñada par...
serenidad APP presentacion.pdfes una innovadora aplicación móvil diseñada par...serenidad APP presentacion.pdfes una innovadora aplicación móvil diseñada par...
serenidad APP presentacion.pdfes una innovadora aplicación móvil diseñada par...
 
Tipos de datos en Microsoft Access definiciones.pdf
Tipos de datos en Microsoft Access definiciones.pdfTipos de datos en Microsoft Access definiciones.pdf
Tipos de datos en Microsoft Access definiciones.pdf
 
Ciberseguridad y Seguridad Informática Franco Correa Grupo B.pptx
Ciberseguridad y Seguridad Informática Franco Correa Grupo B.pptxCiberseguridad y Seguridad Informática Franco Correa Grupo B.pptx
Ciberseguridad y Seguridad Informática Franco Correa Grupo B.pptx
 
TECNOLOGIA DE LA INFORMACION Y MULTIMEDIA 15 MAYO.pptx
TECNOLOGIA DE LA INFORMACION Y MULTIMEDIA 15 MAYO.pptxTECNOLOGIA DE LA INFORMACION Y MULTIMEDIA 15 MAYO.pptx
TECNOLOGIA DE LA INFORMACION Y MULTIMEDIA 15 MAYO.pptx
 
LA CALIDAD DE LA INFORMACION EN LA NUEVA ERA DEL INTERNET
LA CALIDAD DE LA INFORMACION  EN LA NUEVA ERA DEL INTERNETLA CALIDAD DE LA INFORMACION  EN LA NUEVA ERA DEL INTERNET
LA CALIDAD DE LA INFORMACION EN LA NUEVA ERA DEL INTERNET
 
Tkinter para python (curso de interfaces gráficas)
Tkinter para python (curso de interfaces gráficas)Tkinter para python (curso de interfaces gráficas)
Tkinter para python (curso de interfaces gráficas)
 
El necesario mal del Legacy Code (Drupal Iberia 2024)
El necesario mal del Legacy Code (Drupal Iberia 2024)El necesario mal del Legacy Code (Drupal Iberia 2024)
El necesario mal del Legacy Code (Drupal Iberia 2024)
 
CIBERSEGURIDAD Y SEGURIDAD INFORMÁTICA.pptx
CIBERSEGURIDAD  Y SEGURIDAD INFORMÁTICA.pptxCIBERSEGURIDAD  Y SEGURIDAD INFORMÁTICA.pptx
CIBERSEGURIDAD Y SEGURIDAD INFORMÁTICA.pptx
 

Facelets

  • 1. Facelets   Diego  Armando  Gómez  M   dgomez@vortexbird.com    
  • 2. Introducción   •  JavaServer   Facelets   es   un   framework   para   plan5llas   (templates)   centrado   en   la   tecnología  JSF  (JavaServer  Faces),  por  lo  cual   se  integran  de  manera  muy  fácil.  
  • 3. Introducción   •  Caracterís5cas  :   –  Tiempo  de  desarrollo  cero  de  tags  para  UIComponents.   –  Facilidad  en  la  creación  del  templa5ng  para  los   componentes  y  páginas.   –  Es  posible  separar  los  UIComponents  en  diferentes   archivos.   –  Soporte  completo  a  EL  (Expression  Language).   –  No  es  necesaria  configuración  XML.   –  Trabaja  con  cualquier  RenderKit.  
  • 4. Porque  usar  Facelets   •  Independiente  del  contenedor  Web  (Tomcat,  JeTy,  GlassFish,  Jboss,  etc)   •  Facelets  provee  un  proceso  de  compilación  más  rápido  que  JSP.   •  Provee  templa5ng,  lo  cual  implica  reu5lización  de  código,  simplificación   de  desarrollo  y  facilidad  en  el  mantenimiento  de  grandes  aplicaciones.   •  Permite  crear  componentes  ligeros  sin  necesidad  de  crear  los  tags  de  los   UIComponents  (es  más  fácil  comparado  a  crear  un  componente  JSF  puro).   •  Soporta  Unified  Expression  Language,  incluyendo  soporte  para  funciones   EL  y  validación  de  EL  en  5empo  de  compilación.   •  Es  posible  conver5r  template  en  HTML5  fácilmente.   •  En  Facelets,  las  páginas  son  XTHML   •  Facelets  permite  incluir  texto,  e5quetas  y  expresiones  en  cualquier  zona   de  la  página,  y  se  encargará  de  evaluarlo.  
  • 5. Configuración  Maven   •  Solo  se  debe  descargar  el  jar  de  primefaces-­‐ {version}.jar  y  la  impelemtacion  de  referencia   de  jsf,  en  este  caso  mojarra  2.2.9   Maven   <!-­‐-­‐  Primefaces  -­‐-­‐>      <dependency>        <groupId>org.primefaces</groupId>        <ar9factId>primefaces</ar9factId>        <version>5.1</version>      </dependency>      <!-­‐-­‐  Primefaces  à          <dependency>        <groupId>org.glassfish</groupId>        <ar9factId>javax.faces</ar9factId>        <version>2.2.9</version>      </dependency>  
  • 6. Configuración  web.xml   <?xml  version="1.0"  encoding="UTF-­‐8"?>   <web-­‐app  version="3.0"                    xmlns="hNp://java.sun.com/xml/ns/javaee"                    xmlns:xsi=hNp://www.w3.org/2001/XMLSchema-­‐instance    xsi:schemaLoca9on="hNp://java.sun.com/xml/ns/javaee  hNp:// java.sun.com/xml/ns/javaee/web-­‐app_3_0.xsd"  >          <display-­‐name>demoFacelets</display-­‐name>      <welcome-­‐file-­‐list>          <welcome-­‐file>index.xhtml</welcome-­‐file>      </welcome-­‐file-­‐list>      <servlet>          <servlet-­‐name>Faces  Servlet</servlet-­‐name>          <servlet-­‐class>javax.faces.webapp.FacesServlet</servlet-­‐class>          <load-­‐on-­‐startup>1</load-­‐on-­‐startup>      </servlet>      <servlet-­‐mapping>          <servlet-­‐name>Faces  Servlet</servlet-­‐name>          <url-­‐paTern>/faces/*</url-­‐paTern>      </servlet-­‐mapping>          <servlet-­‐mapping>          <servlet-­‐name>Faces  Servlet</servlet-­‐name>          <url-­‐paTern>*.xhtml</url-­‐paTern>      </servlet-­‐mapping>   </web-­‐app>  
  • 7. header.xhtml   <jsp:root  jsfc="f:view"  xmlns:jsp="hNp://java.sun.com/JSP/Page"          xmlns:f="hNp://java.sun.com/jsf/core"          xmlns:h="hNp://java.sun.com/jsf/html"          xmlns:ui="hNp://java.sun.com/jsf/facelets"          xmlns:c="hNp://java.sun.com/jstl/core"          xmlns:p="hNp://primefaces.org/ui"          xmlns:fn="hNp://java.sun.com/jsp/jstl/func9ons">              <html>      <body>        <f:view>          <ui:composi9on>                                      <h1>El  encabezado  de  mi  si9o  Web</h1>                            <p>Esto  es  un  template  con  facelets</p>          </ui:composi9on>        </f:view>      </body>    </html>   </jsp:root>  
  • 8. footer.xhtml   <jsp:root  jsfc="f:view"  xmlns:jsp="hNp://java.sun.com/JSP/Page"    xmlns:f="hNp://java.sun.com/jsf/core"    xmlns:h="hNp://java.sun.com/jsf/html"    xmlns:ui="hNp://java.sun.com/jsf/facelets"    xmlns:c="hNp://java.sun.com/jstl/core"    xmlns:fn="hNp://java.sun.com/jsp/jstl/func9ons">    <html>      <body>        <f:view>          <ui:composi9on>                      <h3>Esta  es  la  parte  inferior</h3>                </ui:composi9on>        </f:view>      </body>    </html>   </jsp:root>  
  • 9. template.xhtml   <html  xmlns="hNp://www.w3.org/1999/xhtml"    xmlns:h="hNp://java.sun.com/jsf/html"    xmlns:ui="hNp://java.sun.com/jsf/facelets">      <h:head>                                  <5tle>.::Titulo  de  mi  app  web::.</5tle>                                            </h:head>      <h:body>            <ui:insert  name="header">            <ui:include  src="/WEB-­‐INF/facelets/header.xhtml"  />        </ui:insert>                <ui:insert  name="body"/>              <ui:insert  name="footer">            <ui:include  src="/WEB-­‐INF/facelets/footer.xhtml"  />        </ui:insert>        </h:body>   </html>  
  • 10. index.xhtml   <html  xmlns="hNp://www.w3.org/1999/xhtml"    xmlns:h="hNp://java.sun.com/jsf/html"    xmlns:p="hNp://primefaces.org/ui"    xmlns:f="hNp://java.sun.com/jsf/core"    xmlns:ui="hNp://java.sun.com/jsf/facelets">        <h:head>      <meta  hTp-­‐equiv="Content-­‐Type"  content="text/html;  charset=UTF-­‐8"/>    </h:head>            <h:body>      <ui:composi5on  template="/WEB-­‐INF/facelets/template.xhtml">          <ui:define  name="body">            <f:view>            <p:keyboard  id="default"  />          </f:view>        </ui:define>          </ui:composi5on>      </h:body>     </html>    
  • 11. Enlaces   •  hTp://docs.oracle.com/javaee/6/tutorial/doc/ gijtu.html   •  hTp://www.mkyong.com/jsf2/jsf-­‐2-­‐ templa5ng-­‐with-­‐facelets-­‐example/  
  • 12. Información  de  contacto   •  Si5o  Web:  www.vortexbird.com   •  Blog:  hTp://blog.vortexbird.com   •  Zathuracode:  www.zathuracode.org   •  Contacto  vía  mail:  dgomez@vortexbird.com   •  Teléfonos:  +57    -­‐  (316  482  4629)