2010-06-19 4 views
0

Je suit ce tutoriel: -Le premier composant composite le plus simple ne fonctionne pas. JSF

http://blogs.oracle.com/enterprisetechtips/entry/true_abstraction_composite_ui_components

Mais cela ne fonctionne pas pour moi.

Ceci est mon index.xhtml: -

<?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" 
     xmlns:ez="http://java.sun.com/jsf/composite/simpleout"> 
    <h:head> 
     <title>Facelet Title</title> 
    </h:head> 
    <h:body> 
     <ez:loginPanel> 

     </ez:loginPanel> 
    </h:body> 
</html> 

Ceci est mon out.xhtml qui est en WEB-INF/resources/simpleout

<!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:composite="http://java.sun.com/jsf/composite"> 
<head> 
<title>This will not be present in rendered output</title> 
</head> 
<body> 

<composite:interface> 
    <composite:attribute name="value" required="false"/> 
</composite:interface> 

<composite:implementation> 
    <h:outputText value="#{cc.attrs.value}" style="background-color: yellow"/> 
</composite:implementation> 
</body> 
</html> 

Je reçois toujours cette erreur: -

•Warning: This page calls for XML namespace http://java.sun.com/jsf/composite/simpleout declared with prefix ez but no taglibrary exists for that namespace. 

Aidez-moi, s'il vous plaît.

Merci à l'avance :)

Répondre

1

composants composites n'appartiennent à une des ressources de répertoire dans la racine web, pas sous WEB-INF. Tout le reste semble être correct. À mon avis, mettre des ressources sous WEB-INF aurait plus de sens car il ne devrait pas être accessible par un navigateur, mais cela semble être ce que dit la spécification.

Questions connexes