Etiquetas de la vista

Por 9.99€ al mes tendrás acceso completo a todos los cursos. Sin matrícula ni permanencia.

Deben estar dentro de las etiquetas <h:body></h:body>

Estructura básica de un documento JSF

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Insert title here</title>
</h:head>
<h:body>

</h:body>
</html>

Recorrer una colección de datos

<ui:repeat value="#{equipoBB.equipos}" var="var">
	<h:outputText value="#{var.nombre}" />
</ui:repeat>

Enviar un objeto desde un enlace dentro de la vista

<ui:repeat value="#{equipoBB.equipos}" var="var">
	<h:form>
		<h:commandLink action="#{equipoBB.consultaEquipo(var)}" value="Enviar" />
	</h:form>
</ui:repeat>

Para que funcione, en el backingBean debemos haber marcado su scope como de sesión:

@ManagedBean
@SessionScoped
public class EquipoBB {

Pintar una imagen

<h:graphicImage value="/imagenesFutbol/#{var.foto_escudo}" />

Por 9.99€ al mes tendrás acceso completo a todos los cursos. Sin matrícula ni permanencia.