[Facelets] Problème avec un Custom component
Bonjour,
j'ai essayé de suivre le tutoriel pour le spinner du bouquin "core JSF"
Seulement mon spinner ne s'affiche pas
J'ai donc un fichier UISpinner.java
Code:
1 2 3 4 5 6
|
package ccjava.presentation.deposeroffre.composants;
...
public class UISpinner extends UIInput {
...
} |
Un fichier SpinnerTag.java
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
package ccjava.presentation.composants;
...
public class SpinnerTag extends UIComponentTag {
private String minimum = null;
private String maximum = null;
private String size = null;
private String value = null;
public String getRendererType() {
return null;
}
public String getComponentType() {
return "spinner";
} |
dans mon faces-config.xml
Code:
1 2 3 4 5
|
<component>
<component-type>spinner</component-type>
<component-class>ccjava.presentation.composants.UISpinner</component-class>
</component> |
dans mon WEB-INF/customs.tld
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 37 38 39 40 41 42 43 44 45
|
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>0.03</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>cf</short-name>
<uri>/WEB-INF/customs.tld</uri>
<description>This tag library contains a spinner tag</description>
<tag>
<name>spinner</name>
<tag-class>ccjava.presentation.composants.SpinnerTag</tag-class>
<attribute>
<name>binding</name>
<description>A value binding that points to a bean property</description>
</attribute>
<attribute>
<name>id</name>
<description>The client id of this component</description>
</attribute>
<attribute>
<name>rendered</name>
<description>Is this component rendered?</description>
</attribute>
<attribute>
<name>minimum</name>
<description>The spinner minimum value</description>
</attribute>
<attribute>
<name>maximum</name>
<description>The spinner maximum value</description>
</attribute>
<attribute>
<name>size</name>
<description>The size of the input field</description>
</attribute>
<attribute>
<name>value</name>
<required>true</required>
<description>The value of the spinner</description>
</attribute>
</tag>
</taglib> |
et dans mon fichier JSPX (j'utilise facelets)
Code:
1 2 3 4 5 6 7 8 9
|
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:cf="/WEB-INF/customs.tld">
...
avant<cf:spinner value="1950" rendered="true" id="yearSpinner" minimum="1900" maximum="2100" size="5" binding="#{loginMB.spinner}"/>après |
J'obtient
"avantaprès"
Le spinner n'apparait pas.
Aucune erreur de compile.