Created
April 8, 2012 14:39
-
-
Save mathieuancelin/2337646 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='UTF-8' ?> | |
<!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"> | |
<h:head> | |
<title>Facelet Title</title> | |
</h:head> | |
<h:body> | |
<h1><h:outputText value="#{monControleur.title}"/></h1> | |
<h:form> | |
<h:commandLink action="#{monControleur.listAll()}" value="Voir liste" /> | |
</h:form> | |
<h:graphicImage url="/test.jpg" /> | |
<ul> | |
<ui:repeat value="#{monControleur.values}" var="value"> | |
<li> | |
<h:outputText value="#{value}" /> | |
</li> | |
</ui:repeat> | |
</ul> | |
<h:dataTable value="#{monControleur.produits}" var="produit"> | |
<h:column rowHeader="Nom"> | |
<h:outputText value="#{produit.nom}" /> | |
</h:column> | |
<h:column rowHeader="Prix"> | |
<h:outputText value="#{produit.prix}" /> | |
</h:column> | |
</h:dataTable> | |
</h:body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.enterprise.context.RequestScoped; | |
import javax.inject.Named; | |
import javax.inject.Inject; | |
@Named | |
@RequestScoped | |
public class MonControleur { | |
@Inject MonModele modele; | |
public String getTitle() { | |
return "Hello World!"; | |
} | |
public String listAll() { | |
// code metier | |
return "list.xhtml"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.enterprise.context.SessionScoped; | |
import javax.inject.Named; | |
@Named | |
@SessionScoped | |
public class MonModele { | |
private String title; | |
public String getTitle() { | |
return title; | |
} | |
public void setTitle(String title) { | |
this.title = title; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment