【问题标题】:Richfaces tags are ignoredRichfaces 标签被忽略
【发布时间】:2012-08-08 11:38:39
【问题描述】:

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

看起来像

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

我使用 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>

【问题讨论】:

  • 请发布您的完整 XHTML 代码。根据您模糊的描述,很难猜出问题出在哪里。
  • @eljunior 我添加了 xhtml 代码。

标签: java jsf richfaces java-ee-6


【解决方案1】:

尝试在页面上添加 h:head 和 h:body 标签,而不是普通的 html 标签 head 和 body

【讨论】:

  • XHTML 完全错误 :-)) 但是 h:head 和 h:body 最终是解决方案。谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-01-14
  • 2013-01-16
  • 2015-02-02
  • 1970-01-01
  • 2014-10-07
  • 1970-01-01
  • 2011-07-22
相关资源
最近更新 更多