[a4j:pool] not working with RF 3.1.6, Sun RI 1.1 and JSP ?
jep Jul 10, 2008 3:16 AMHello.
I'm trying to use the poll example from the RichFaces (3.1.6) demo but with the Sun RI 1.1 JSF and a JSP presentation page under Tomcat 6 / JDK 5.0. Unfortunately it doesnt work. I do have a "Header Ajax-Update-Ids not found" ajax response.
JSP PAGE
-----------
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
*html*
<f:view>
*head**title*Simple jsp page*/title**/head*
*body*
<a4j:region>
<a4j:form>
<a4j:poll id="poll" interval="500" enabled="#{pollBean.pollEnabled}"
reRender="poll,grid"/>
</a4j:form>
</a4j:region>
<a4j:form>
<h:panelGrid id="grid" columns="2" width="80%">
<h:panelGrid columns="1">
<h:outputText value="Polling Inactif" rendered="#{not pollBean.pollEnabled}"></h:outputText>
<h:outputText value="Polling Actif" rendered="#{pollBean.pollEnabled}"></h:outputText>
<a4j:commandButton id="control"
reRender="poll,grid"
style="width:120px"
value="#{pollBean.pollEnabled?'Stop':'Start'} Polling">
<a4j:actionparam name="polling" value="#{!pollBean.pollEnabled}"
assignTo="#{pollBean.pollEnabled}"/>
</a4j:commandButton>
</h:panelGrid>
<h:outputText id="serverDate" style="font-size:16px"
value="Date serveur: #{pollBean.date}"/>
</h:panelGrid>
</a4j:form>
<a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"></a4j:log>
*/body*
</f:view>
*/html*
LIBS
------
jsf-api.jar
jsf-impl.jar
jstl-1.1.0.jar
richfaces-api-3.1.6.GA.jar
richfaces-impl-3.1.6.GA.jar
richfaces-ui-3.1.6.GA.jar
POLLBEAN
------------
public class PollBean {
private boolean pollEnabled;
private Date pollStartTime;
private Date date;
public PollBean() {
}
public boolean getPollEnabled() {
System.out.println("getPollEnabled: " + pollEnabled);
System.out.flush();
return pollEnabled;
}
public void setPollEnabled(boolean pollEnabled) {
System.out.println("setPollEnabled: " + pollEnabled);
System.out.flush();
if (pollEnabled) setPollStartTime(null);
this.pollEnabled = pollEnabled;
}
public Date getDate() {
System.out.println("getDate");
System.out.flush();
Date date = new Date();
if (null == pollStartTime) {
pollStartTime = new Date();
return date;
}
if ((date.getTime() - pollStartTime.getTime()) >= 60000) setPollEnabled(false);
return date;
}
public void setDate(Date date) {
System.out.println("setDate: " + date);
System.out.flush();
this.date = date;
}
public Date getPollStartTime() {
System.out.println("getPollStartTime()");
System.out.flush();
return pollStartTime;
}
public void setPollStartTime(Date pollStartTime) {
System.out.println("setPollStartTime: " + pollStartTime);
System.out.flush();
this.pollStartTime = pollStartTime;
}
}
A4J.LOG
----------
debug[9:05:53,149]: Have Event [object Object] with properties: target: [object HTMLInputElement], srcElement: undefined, type: click
debug[9:05:53,180]: NEW AJAX REQUEST !!! with form :_id2
debug[9:05:53,180]: Append hidden control _id2 with value [_id2] and value attribute [_id2]
debug[9:05:53,180]: Append hidden control autoScroll with value [] and value attribute []
debug[9:05:53,180]: parameter polling with value true
debug[9:05:53,180]: parameter _id2:control with value _id2:control
debug[9:05:53,180]: Start XmlHttpRequest
debug[9:05:53,180]: Reqest state : 1
debug[9:05:53,180]: QueryString: AJAXREQUEST=_viewRoot&_id2=_id2&autoScroll=&polling=true&_id2%3Acontrol=_id2%3Acontrol&
debug[9:05:53,195]: Reqest state : 1
debug[9:05:53,211]: Reqest state : 2
debug[9:05:53,211]: Reqest state : 3
debug[9:05:53,211]: Reqest state : 4
debug[9:05:53,211]: Reqest end with state 4
debug[9:05:53,211]: Response with content-type: text/xml;charset=UTF-8
debug[9:05:53,211]: Full response content: <?xml version="1.0"?> Simple jsp page
debug[9:05:53,211]: Header Ajax-Update-Ids not found, search in
debug[9:05:53,211]: search for elements by name 'meta' in element #document
debug[9:05:53,242]: getElementsByTagName found 4
debug[9:05:53,242]: Find
warn[9:05:53,242]: No information in response about elements to replace
debug[9:05:53,242]: call getElementById for id= ajax-view-state
debug[9:05:53,242]: Hidden JSF state fields: [object HTMLSpanElement]
debug[9:05:53,242]: Namespace for hidden view-state input fields is undefined
debug[9:05:53,242]: search for elements by name 'input' in element span
debug[9:05:53,242]: getElementsByTagName found 0
debug[9:05:53,242]: Replace value for inputs: 5 by new values: 0
debug[9:05:53,242]: search for elements by name 'INPUT' in element span
debug[9:05:53,258]: getElementsByTagName found 0
debug[9:05:53,258]: Replace value for inputs: 5 by new values: 0
debug[9:05:53,258]: call getElementById for id= _A4J.AJAX.focus
debug[9:05:53,258]: No focus information in response
debug[9:05:53,258]: call getElementById for id= org.ajax4jsf.oncomplete