Richfaces标签被忽略

时间:2012-08-08 11:38:39

标签: java jsf richfaces java-ee-6

我在XHTML页面中使用了一些Richfaces标签。但他们被忽略了。

看起来像enter image description here

问题出在哪里?有什么想法吗?

我使用Wepshere 8作为AppServer

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 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:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">
<!-- html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">
<head>
<title>RichFaces Greeter</title>
</head>
<body>
    <f:view -->
        <h:form>
            <rich:panel header="RichFaces Greeter" style="width: 315px">
                <h:outputText value="Your name: " />
                <h:inputText value="#{user.name}">
                    <f:validateLength minimum="1" maximum="30" />
                </h:inputText>
                <a4j:commandButton value="Get greeting" reRender="greeting" />
                <h:panelGroup id="greeting">
                    <h:outputText value="Hello, " rendered="#{not empty user.name}" />
                    <h:outputText value="#{user.name}" />
                    <h:outputText value="!" rendered="#{not empty user.name}" />
                </h:panelGroup>
            </rich:panel>
            <rich:inputNumberSlider minValue="1"  maxValue="100" showInput="false"/>
            <rich:inputNumberSpinner minValue="1" maxValue="100"/>  
        </h:form>
    <!-- /f:view>
</body>
</html -->
</ui:composition>

1 个答案:

答案 0 :(得分:2)

尝试在页面上添加h:head和h:body标签,而不是正常的html标签头部和身体