5

使用以下 jspx 代码

<jsp:root jsfc="f:view" xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ice="http://www.icesoft.com/icefaces/components"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions">

    <ui:composition template="WEB-INF/includes/template/main-template.jspx"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:ice="http://www.icesoft.com/icefaces/components"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:m="http://www.tag.com/jsf">

        <!-- params for page titles-->
        <ui:define name="content">
            <ice:form id="iceForm" partialSubmit="true">
                <ice:panelGroup styleClass="error">
                    <ice:messages id="error" />
                </ice:panelGroup>
                <ice:panelGroup styleClass="progress"
                    rendered="#{login.inProgress and exportselection.renderView}">

                    <ice:panelGroup style="margin-top: 3px">
                        <ice:outputProgress id="buildView" labelPosition="embed"
                            labelComplete="completed" indeterminate="false"
                            rendered="#{login.inProgress and exportselection.renderView}"
                            value="#{exportselection.progressStatus}" />
                        <ice:panelGroup styleClass="cellTopRight">
                            <ice:panelGrid columns="2" cellspacing="10">
                                <ice:commandButton value="#{msgs['xliff.button.cancel1']}"
                                    id="resetbutton" action="export"
                                    rendered="#{login.inProgress and exportselection.renderView}"
                                    actionListener="#{exportselection.cancel}" />
                                <ice:commandButton value="#{msgs['xliff.button.next']}"
                                    id="nextger1"
                                    rendered="#{login.inProgress and exportselection.renderView}"
                                    action="#{exportselection.forward}"
                                    disabled="#{login.inProgress}"
                                    actionListener="#{exportselection.showExportView}" />
                            </ice:panelGrid>
                        </ice:panelGroup>
                    </ice:panelGroup>
                </ice:panelGroup>
                <ice:panelGrid styleClass="datapaging"
                    rendered="#{!exportselection.renderView}">

                    <ice:dataTable id="texts" var="text"
                        value="#{generatexliff.showTexts}" scrollable="true"
                        scrollHeight="300px" styleClass="dataPaginatorDataTable"
                        columnWidths="300px,200px,200px,100px">

                        <!-- ice:column>
                        <f:facet name="header">
                            <ice:outputText id="column1"
                                            value="#{msgs['export.view.date']}"/>
                        </f:facet>
                        <ice:outputText id="date" 
                                        value="#{text.showDate}"/>
                   </ice:column-->

                        <ice:column>
                            <f:facet name="header">
                                <ice:outputText id="column2" value="#{msgs['export.view.text']}" />
                            </f:facet>
                            <ice:outputText id="content" value="#{text.text}" />
                        </ice:column>

                        <ice:column>
                            <f:facet name="header">
                                <ice:outputText id="column3"
                                    value="#{msgs['export.view.master']}" />
                            </f:facet>
                            <ice:outputText id="master" value="#{text.appearInString}" />
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <ice:outputText id="column4"
                                    value="#{msgs['export.view.comment']}" />
                            </f:facet>
                            <ice:inputText id="comment" size="40"
                                value="#{text.transComment}" />
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <ice:outputText id="column5"
                                    value="#{msgs['export.view.export']}" />
                            </f:facet>
                            <ice:selectBooleanCheckbox id="select" value="#{text.selected}"
                                partialSubmit="true" />
                        </ice:column>
                    </ice:dataTable>
                    <ice:panelGrid columns="5" cellpadding="2px"
                        styleClass="datapaging">
                        <ice:commandButton id="first"
                            image="/images/css-images/arrow-first.gif"
                            actionListener="#{generatexliff.first}" />
                        <ice:commandButton id="previous"
                            image="/images/css-images/arrow-previous.gif"
                            actionListener="#{generatexliff.previous}" />
                        <ice:panelGroup>
                            <ice:outputText id="paging" value="Page" />
                            <ice:inputText id="currentPage" size="5"
                                value="#{generatexliff.currentPage}"
                                valueChangeListener="#{generatexliff.jump}" partialSubmit="true">
                                <f:validateLongRange></f:validateLongRange>
                            </ice:inputText>
                            <ice:outputText value=" of #{generatexliff.totalPage}" />
                        </ice:panelGroup>
                        <ice:commandButton id="next"
                            image="/images/css-images/arrow-next.gif"
                            actionListener="#{generatexliff.next}" />
                        <ice:commandButton id="last"
                            image="/images/css-images/arrow-last.gif"
                            actionListener="#{generatexliff.last}" />
                    </ice:panelGrid>
                    <ice:dataTable id="errorMessage" var="message" border="0"
                        value="#{generatexliff.messages}"
                        rendered="#{!exportselection.renderView and generatexliff.xliffAvailable}">
                        <ice:column>
                            <ice:outputText id="mess" styleClass="error" value="#{message}" />
                        </ice:column>
                    </ice:dataTable>

                    <ice:outputProgress id="export" labelPosition="embed"
                        labelComplete="completed" indeterminate="false"
                        value="#{generatexliff.progressStatus}"
                        rendered="#{!exportselection.renderView}" />
                    <ice:panelGrid columns="2" styleClass="xliffTopRight">
                        <ice:dataTable id="files" var="file"
                            value="#{generatexliff.xmlResources}" scrollable="true"
                            scrollHeight="100px"
                            rendered="#{!exportselection.renderView and generatexliff.xliffAvailable}"
                            styleClass="dataPaginatorDataTable" columnWidths="300px">
                            <ice:column>
                                <f:facet name="header">
                                    <ice:outputText value="#{msgs['xliff.output.download']}" />
                                </f:facet>
                                <ice:outputResource id="imgRsource" resource="#{file.file}"
                                    label="XLIFF - #{file.fileName}" fileName="#{file.fileName}"
                                    attachment="true" shared="false" />
                            </ice:column>
                        </ice:dataTable>
                        <ice:panelGrid columns="2" styleClass="cellTopRight"
                            rendered="#{!exportselection.renderView}">


                            <ice:commandButton value="#{msgs['xliff.button.cancel']}"
                                id="exportcancel" disabled="#{!login.inProgress}"
                                actionListener="#{generatexliff.cancel}" />
                            <ice:commandButton value="#{msgs['xliff.button.generate']}"
                                id="exportXliff" disabled="#{login.inProgress}"
                                actionListener="#{generatexliff.generateXLIFF}" />

                        </ice:panelGrid>
                    </ice:panelGrid>
                </ice:panelGrid>
            </ice:form>
        </ui:define>
    </ui:composition>
</jsp:root>

Eclipse给了我错误

“ice:column”缺少开始标签

在线上

xmlns:fn="http://java.sun.com/jsp/jstl/functions">

红色波浪下划线n.com/jsp/jst。那里发生了什么?我该如何解决?除了那个错误之外,该项目构建良好......?

编辑:该项目具有以下方面:

  • 动态网页模块 3.0
  • Java 1.6
  • JavaScript 1.0
  • JavaServer Faces 2.0

我尝试禁用 JSF 上的验证并再次重新启用它,但是一旦我再次构建,错误就会再次出现。

4

2 回答 2

2

不应该

 xmlns:ice="http://www.icesoft.com/icefaces/component"

它应该是

 xmlns:ice="http://www.icesoft.com/icefaces/components"

那应该可以解决您的问题。

确保将 icefaces 组件添加到项目的步骤得到处理,例如将库添加到类路径等,

很少参考: 参考 3.x 版的 API 文档

与 Icefaces 相关的其他参考资料

于 2014-08-06T12:34:15.660 回答
2

这是错误的

                   <!-- ice:column>
                   <f:facet name="header">
                       <ice:outputText id="column1"
                                       value="#{msgs['export.view.date']}"/>
                   </f:facet>
                   <ice:outputText id="date" 
                                   value="#{text.showDate}"/>
              </ice:column-->

注释代码写成:

<!-- Comment here -->

OR

<!--
Comment
over
multiple lines
-->

错误是正确的,你没有 ice:column 的开始标签。您开始注释行,但随后在第一行的末尾关闭它,因为您从未为 ice:column 放入开头 <。因此,当它到达行尾的 > 时,程序假定这是注释行的结束标记。

我相信这将有助于注释掉多行代码:

                   <!-- 
                   <ice:column>
                   <f:facet name="header">
                       <ice:outputText id="column1"
                                       value="#{msgs['export.view.date']}"/>
                   </f:facet>
                   <ice:outputText id="date" 
                                   value="#{text.showDate}"/>
                   </ice:column>
                   -->

我意识到这是一个旧线程,但我想我会添加一个答案,以防其他人偶然发现这个问题。

于 2015-10-21T10:51:49.827 回答