@ManagedBean marche plus avec faces-config.xml ?
Bonjour,
Je suis un TOTAL noob sur Java et donc aussi sous JSF.
Je m'amuse depuis quelques heures sur JSF 2, mais franchement il y a un truc qui m'échappe.
Quand je n'ai aucun faces-config.xml mon application marche bien, à savoir que lorsque je vais sur :
http://localhost:8080/faces-tutorial...count-form.jsp
Je vois bien :
Nom : oxman
Qui est affiché avec :
Code:
1 2
|
<html:outputText value="Nom : #{accountDatas.customer.name}"/> |
Ce qui donc marche parfaitement sans faces-config.xml
Dès que je créer un faces-config.xml pour ma navigation, ma page "http://localhost:8080/faces-tutorial/faces/account-form.jsp"
affiche :
Nom :
Comme si le ManagedBean n'était pas appelé.
dans ma classe AccountDatas j'ai :
Code:
1 2 3 4 5 6 7 8 9 10 11
|
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
/**
*
* @author oxman
*/
@ManagedBean
@SessionScoped
... |
Et dans mon faces-config.xml j'ai :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2003 Sun Microsystems, Inc. All rights reserved.
SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<application>
<locale-config>
<default-locale>fr</default-locale>
</locale-config>
</application>
<navigation-rule>
<from-view-id>/account-form.jsp</from-view-id>
<navigation-case>
<from-outcome>AccountDatasOK</from-outcome>
<to-view-id>/success.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>AccountDatasError</from-outcome>
<to-view-id>/error.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config> |
Il doit y avoir quelque chose qui m'échappe, désolé si ma question est bête :)
Merci de votre aide :)