JSF Facelets Form嵌套的问题 The form action element can

本文描述了在使用Facelets过程中遇到的表单嵌套问题及其解决方案。作者最初遭遇了一个错误,提示表单元素不能嵌套。通过仔细检查发现了一个内部表单被错误地嵌套在另一个表单中,调整后问题得以解决。

一个javax.faces.FacesException: Problem in renderResponse: Nested form found on the page. The form action element can not be nested错误,又是找遍各大搜索引擎都没见结果,还是在ICEFaces的论坛里面有人提了这个问题,然后回答竟然是facelets的一个bug,并且ICEFaces的新版本会在自己的facelets实现里面修改这个补丁。

碰巧了,ICEFaces在20080414出了新版本,我遇到这个问题的同天……

下了新版本,简单看了下说明,更新到项目里面,运行,好了……

还没有结束……

 

 

解决了问题,休息会,喝杯茶,回来,运行,问题再现,一模一样,郁闷致死啊。

找了半天尝试了各种情况,未见结果。于是放弃两天的工作,重新换方法写。写到今天,20080416,直到出现一个情况,我点了页面上的不相干的链接,竟然造成一个不相干的表单的提交……Form出问题了

找啊找,在facelets一个页面n个insert、include、define等等的情况下,找到有一个Form嵌套在另外一个顶层template的Form里面了,调整了下,ok,问题解决……

 

哎,上面这么多,我自己都觉得太唐僧了点。谁让我又解决了一个问题高兴呢。虽然是非常郁闷的问题。

 

用facelets是方便了,但是一定要事先设计好,到做的时候临场发挥是最容易出问题的。灵活方便不见得是好事……

报错Message:Error Parsing //data/wls/config/domains/domain03/servers/MS1/stage/LkmPmi/LkmPmi.ear/LkmPmi.war/WEB-INF/lib/EventDataReportJsf.jar!/META-INF/resources/zhuanxu/zhuanxureport.jsf: Error Traced[line: 172] The element type "ui:define" must be terminated by the matching end-tag "</ui:define>".javax.faces.view.facelets.FaceletException: Error Parsing //data/wls/config/domains/domain03/servers/MS1/stage/LkmPmi/LkmPmi.ear/LkmPmi.war/WEB-INF/lib/EventDataReportJsf.jar!/META-INF/resources/zhuanxu/zhuanxureport.jsf: Error Traced[line: 172] The element type "ui:define" must be terminated by the matching end-tag "</ui:define>".,<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:p="http://primefaces.org/ui" template="/templates/LkmTemplate.jsf"> <ui:param name="pageTitle" value="转序效率分析"/> <ui:define name="head"> <h:outputScript name="js/highchart3.6/event-highcharts.js" target="body"/> <h:outputScript name="js/event-exporting.js" target="body"/> </ui:define> <ui:define name="content-introduction"> <h1>转序效率分析</h1> </ui:define> <ui:define name="content"> <div class="ui-fluid"> <div id="contentId"> <p:panel style="display: -webkit-inline-flex"> <div class="ui-inputgroup" style="display:inline-block;"> <span class="ui-inputgroup-addon" style="width:55px;">类型</span> <p:selectOneMenu id="eventType" value="#{zhuanXuReportBean.eventType}" style="width:110px;" panelStyle="width:180px;"> <f:selectItem itemLabel="选择类型" itemValue=""/> <f:selectItems value="#{zhuanXuReportBean.typeList}"/> </p:selectOneMenu> </div> <p:spacer width="10px"/> <div class="ui-inputgroup" style="display:inline-block;"> <span class="ui-inputgroup-addon" style="width:55px">组织</span> <p:selectOneMenu id="org" value="#{zhuanXuReportBean.org}" style="width:80px"> <f:selectItem itemLabel="组织" itemValue=""/> <f:selectItem itemLabel="河源" itemValue="河源"/> <f:selectItem itemLabel="杭州" itemValue="杭州"/> </p:selectOneMenu> </div> <p:spacer width="5px" height="10px"/> <div class="ui-inputgroup" style="display:inline-block;"> <span class="ui-inputgroup-addon">统计始 </span> <p:calendar id="startDate" pattern="yyyy-MM-dd" value="#{zhuanXuReportBean.startDate}" inputStyle="width:90px"></p:calendar> </div> <p:spacer width="5px" height="10px"/> <div class="ui-inputgroup" style="display:inline-block;"> <span class="ui-inputgroup-addon">统计止 </span> <p:calendar id="endDate" pattern="yyyy-MM-dd" value="#{zhuanXuReportBean.endDate}" inputStyle="width:90px"></p:calendar> </div> <p:spacer width="5px" height="10px"/> <h:commandButton id="searchBtn" class="searchBtn" actionListener="#{zhuanXuReportBean.doSearch}" oncomplete="updateChart()" icon="fa fa-search" value="查询" update="dataTableId" style="width:80px;height:33px;background-color:#007ad9;border: 1px solid #007ad9;color: #ffffff;"/> </p:panel> </div> </div> <div> <p:dataTable id="dataTableId" widgetVar="dataTableId" emptyMessage="没有找到相关记录" value="#{zhuanXuReportBean.lazyEventDataList}" var="zx" styleClass="data-table centered-table fixed-layout-table" paginator="true" rows="6" paginatorPosition="bottom" rowsPerPageTemplate="5,10,20" lazy="true" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"> <!-- ID列 --> <p:column headerText="姓名" style="text-align:center;width:40px"> <h:outputText value="#{zx.name}" styleClass="ellipsis-text"/> </p:column> <!-- 名称列 --> <p:column headerText="工号" style="text-align:center;width:50px"> <h:outputText value="#{zx.empNo}" styleClass="ellipsis-text"/> </p:column> <!-- 地址列 --> <p:column headerText="时间跨度" style="text-align:center;width:130px "> <h:outputText value="#{zx.searchDate}" styleClass="ellipsis-text"/> </p:column> <!-- 创建时间列 --> <p:column headerText="转序数量" style="text-align:center;width:130px"> <p:column headerText="正常" style="text-align:center;width:60px"> <h:outputText value="#{zx.normalTimeNum}" styleClass="ellipsis-text"/> </p:column> <p:column headerText="超时" style="text-align:center;width:60px"> <h:outputText value="#{zx.overTimeNum}" styleClass="ellipsis-text"/> </p:column> </p:column> <!-- 备注列 --> <p:column headerText="操作" style="text-align:center;width:60px"> <p:commandLink update="@form:createDept" value="查看明细" action="#{zx.openEventDataDialog(zx)}" styleClass="centered-link"/> </p:column> </p:dataTable> </div> <div id="chartData" class="chartData" style="height:400px;"></div> <h:outputScript> document.addEventListener('DOMContentLoaded', function () { var chart1; var categories = #{zhuanXuReportBean.categoriesStr}; var salesData = #{zhuanXuReportBean.salesDataStr}; var eventType = '#{zhuanXuReportBean.eventType!=""?zhuanXuReportBean.eventType:"转序效率"}'; chart1 = new Highcharts.Chart({ chart: { renderTo: 'chartData', type: 'column' }, title: { text: eventType+'分析(件数)', x: -20 //center }, xAxis: { categories: eval(categories) }, yAxis: { title: { text: eventType+'分析(件数)', }, min: 0, plotLines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { crosshairs: true, valueSuffix: '', shared: true }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: eval(salesData) }); // 更新图表数据 function updateChart() { var newCategories = #{engWojiaBean.categoriesStr}; var salesData = #{engWojiaBean.salesDataStr}; chart1.xAxis[0].setCategories(newCategories); chart1.series[0].setData(salesData); var series = chart1.series; series[1].hide(); series[2].hide(); series[5].hide(); } }); </h:outputScript> </div> </ui:define> </ui:composition>
08-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值