我在加载 JSF 页面时遇到了下面提到的错误。页面加载成功,页面上所需的操作也已完成,但出现此错误。
jsf 页面包含选项卡面板,单击每个选项卡面板都会出现错误。我还发现,如果我将页面的某个部分保留为 render=false 则错误不会出现,但该部分再次不会重新呈现。
我将 JSF2.0 与 JSP 一起使用。和 RF3.3
ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
javax.faces.FacesException: Error decode resource data
at org.ajax4jsf.resource.ResourceBuilderImpl.decrypt(ResourceBuilderImpl.java:627)
at org.ajax4jsf.resource.ResourceBuilderImpl.getResourceDataForKey(ResourceBuilderImpl.java:371)
at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:156)
at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:508)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.zip.DataFormatException: incorrect data check
at java.util.zip.Inflater.inflateBytes(Native Method)
at java.util.zip.Inflater.inflate(Inflater.java:238)
at java.util.zip.Inflater.inflate(Inflater.java:256)
at org.ajax4jsf.resource.ResourceBuilderImpl.decrypt(ResourceBuilderImpl.java:621)
... 25 more
jsf页面和组件的代码片段,当bean中的render=false时不会抛出上述错误。
<rich:tab ignoreDupResponses="true" id="tabModify"
style="overflow:auto" styleClass="richTab" label="#{}"
eventsQueue="queueForTab" actionListener="#{}">
<rich:layout>
<rich:layoutPanel position="right" id="pnlmodfy">
<h:form id="frmModify">
<h:panelGrid>
<h:outputLabel value="#{} * :" escape="false" styleClass="intro" />
<h:outputText value=" : " styleClass="intro" />
<rich:comboBox id="Mdfy" value="#{Bean.str}"
suggestionValues="#{Bean.arraylist}">
<a4j:support id="id"
actionListener="#{Bean.actionListener}"
ajaxSingle="true" event="onchange" reRender="modify">
</a4j:support>
</rich:comboBox>
</h:panelGrid>
<a4j:outputPanel id="modify" ajaxRendered="true">
<h:panelGrid columns="3" id="modify">
<h:outputText value="Description *" styleClass="intro"/>
<h:outputText value=" : " styleClass="intro" />
<h:inputTextarea id="Desc" required="true"
styleClass="textBox" label="Description"
value="#{Bean.strDesc}">
</h:inputTextarea>
如果 outputPanel 绑定到支持 bean 以进行渲染,并且最初将值设置为 false,则不会出现错误。然而,在重新渲染 outputPanel 时,outputPanel 永远不会出现。
问题基本上出现在包含组件上。我在页面中有 4 个标签。在两个选项卡上,我使用 listshuttle(每个选项卡上有 2 个组件)。在两个选项卡上,绑定到 listshuttle 的源和目标的数组列表是相同的。
是不是因为这个原因,我将同一个列表绑定到两个航天飞机。但是,另一个选项卡中的相同代码绝对可以正常工作......
ListShuttle 代码:-
<h:outputText value="Select" styleClass="intro" rendered="#{!empty Bean.lstAvailable}"/>
<h:outputText value=" : " styleClass="intro" />
<rich:listShuttle id="listShuttleN" sourceValue="#{Bean.lstAvailable}" targetValue="#{KPIManagement.lstSelected}" var="items" listsHeight="100" sourceListWidth="100" targetListWidth="100" sourceCaptionLabel="Available" targetCaptionLabel="Selected" rendered="#{!empty Bean.lstAvailable}">
<rich:column>
<h:outputLabel value="#{items}"></h:outputLabel>
</rich:column>
</rich:listShuttle>
数组列表代码:-
ArrayList<String> lstAvailable=new ArrayList<String>();
里面的一些功能
lstAvailable=class.function(Some variable))
this.setLstAvailable(lstAvailable);
观察到这篇文章的可能答案是我正面临某种浏览器问题。
当从另一台机器访问相同的应用程序时,绝对没有例外......这很奇怪,因为我使用的是 Firefox 11.0 而另一台机器有 Firefox 4.0
这真的是浏览器的问题吗??