我有一个使用RichFaces(4.3.6)和PrimeFaces(5.0)的JSF(2.2.5)项目,代码如下
<h:panelGroup>
<a4j:region>
<h:form>
<a4j:poll id="poll" interval="15000" enabled="#{card.poll}"
reRender="swimlanes @parent" actionListener="#{card.reloadData}" />
</h:form>
</a4j:region>
<h:form>
<a4j:outputPanel id="swimlanes">
<h:panelGroup>
Stuff
</h:panelGroup>
</a4j:outputPanel>
</h:form>
</h:panelGroup>
这与RichFaces页面的示例非常相似,但是当轮询启用时,我会收到以下错误,并且不会发生reRendering
debug[09:41:56.298]: New request added to queue. Queue requestGroupingId changed to j_idt20:poll
debug[09:41:56.299]: Queue will wait 0ms before submit
debug[09:41:56.299]: richfaces.queue: will submit request NOW
info [09:41:56.302]: Received 'begin' event from <span id=j_idt20:poll ...>
info [09:41:57.310]: Received 'beforedomupdate' event from <span id=j_idt20:poll ...>
debug[09:41:57.312]: Server returned responseText: <partial-response id="j_id1"><changes><update id="j_idt20:poll"><![CDATA[<span style="display:none;" id="j_idt20:poll"><script type="text/javascript">new RichFaces.ui.Poll("j_idt20:poll",{"enabled":true,"interval":15000,"ontimer":function(event){RichFaces.ajax("j_idt20:poll",event,{"incId":"1"} )}} )</script></span>]]></update><update id="javax.faces.ViewState"><![CDATA[zl8Yr/2cJTwlpFZfrKzxi16KSE/7HTOE5e3ptnUnBJgIouLrdwKWDtUDlUWXx3gmmcCA9jCPG6jpktimoa1GPe4Icqn0EC/f4uetGoNQqAoieOT+2vVVDmQPQclPxvnaZU/3T+2fUyMU2YU5YF0C6/WrStC+UGJzhts1AIP0v6tZ2PHC5XqZhb1hpg6943W4/61rQBNNMRDYerzyipmtFkNLLQm5VtyfVqijlaQhzeP1QJeOqTDHtFAnBN78Ie6E3uGgufi8wX9jVeIXkkaI29OERWotflx2OKaJSakb/lWXMMjjU4NTejwT6IOLx2Mw5mstciSUCRMPzAbA19OK7uFh+Zun2CPRG27T3RH9je9C7iVwxjlZNXKuUhW/QlyPWoyZkhCpfp5Xxc+eruD/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qjCNxC7P4hbnR3OuIMMnsMyoXZCxj++ftsrXpNtqOAE6APZv6ph8E5I2KSmNe3BJiVqjYoybbLbrfbaLcAr5uR3y53BZDyHOukm/KWzk/EfNTed7wlLvOzZ6RFKWIqycF24sXNj/9OHHAsT3U8+lWnSy3O+dC+Yk49oL8CG6pLzL3weP68ztFnbI/FqgpyVocDPRs/gvySPWNqidGJqkqArnKglDa7DeX/uL/Lf+hcvNvge8fv87/FEll6amlKvIc84YEr2JWtUsgpmr4rB1L7/HvihIyCcmZT3VoBpqzuixsGWt48mZFAcMJVPzbWbVmPu8eUitCfq94rQGU5jq7DeDT131wUHnl/T3Ylpx5pd2hd0zDClN53MnaeyAoH9u+rYaU2ilkWWn0uq9Elt7VCU1MdIHu+RNb14JwnRQNCuPrXXW7Oaz8UlTO1RIODuDLLP6oVJP9YGa3qP6U9Kws9du4iJ9LYEt5DNeZvzJSRTTYrY=]]></update><extension id="org.richfaces.extension"><render>j_idt20:poll</render></extension></changes></partial-response>
warn [09:41:57.318]: richfaces.queue: ajax submit error: During update: javax.faces.ViewState not found
debug[09:41:57.319]: richfaces.queue: Nothing to submit
error[09:41:57.320]: Received 'error@malformedXML' event from <span id=j_idt20:poll ...>
error[09:41:57.321]: [status=200] During update: javax.faces.ViewState not found
info [09:41:57.321]: Received 'complete' event from <span id=j_idt20:poll ...>
这是web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Agile Development Tools</display-name>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
请知道如何解决这个问题?
答案 0 :(得分:0)
这是RichFaces 4.3.7及更早版本的BUG!
RF版本4.5和5.0中不存在此Bug