bonjour,

J'ai créé un Managed Bean:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
package bean;
 
import javax.faces.bean.ManagedBean;
 
@ManagedBean
public class NumberBean {
 
	private int number = 1;
 
	public int getNumber() {
		return number;
	}
 
}
J'essaye de récupérer la valeur de number:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
<?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:ui="http://java.sun.com/jsf/facelets"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core">
	  <h:head>
	  	<title>Example Title</title>
	  </h:head>
	  <h:body>
	  	<h:outputText value="#{numberBean.number}"/>
	  	<h:inputText/>
	  </h:body>
</html>
Mais le navigateur ne l'affiche pas.

Aidez-moi à trouver une solution s'il vous plait, merci