特立尼达民意调查 jsf
您好,我正在尝试使用 tr:poll 但没有成功。 我的 jspx 看起来像在 body 标签内,
<f:view>
<tr:document></tr:document>
<tr:form>
<tr:poll id="poller" interval="500" pollListener="#{sessionScope.mainBean.polled}" ></tr:poll>
<tr:outputText value="#{sessionScope.mainBean.count }" partialTriggers="poller"></tr:outputText>
</tr:form>
主 bean 看起来像
public class MainBean
{
private String user;
private int count = 0;
public MainBean(String user)
{
this.user = user;
}
public void polled(org.apache.myfaces.trinidad.event.PollEvent poe)
{
System.out.println(count + "polled by "+user);
++count;
}
public int getCount()
{
return count;
}
}
但 polled 只被调用一次。
这里有什么问题吗?
编辑:
大家好,
看来我太蹩脚了,根本无法让 ppr 工作,别管民意调查了。 我已经在这里上传了归档的 eclipse 项目,我使用的是 JSF 2.0 和 trinidad 2.0,jstl 1.2。 http://www.mediafire.com/?u35h0k65qh5ed71 它与上面描述的几乎相同。
Hi i am trying to use tr:poll with no success.
My jspx looks like inside body tag,
<f:view>
<tr:document></tr:document>
<tr:form>
<tr:poll id="poller" interval="500" pollListener="#{sessionScope.mainBean.polled}" ></tr:poll>
<tr:outputText value="#{sessionScope.mainBean.count }" partialTriggers="poller"></tr:outputText>
</tr:form>
And main bean looks like
public class MainBean
{
private String user;
private int count = 0;
public MainBean(String user)
{
this.user = user;
}
public void polled(org.apache.myfaces.trinidad.event.PollEvent poe)
{
System.out.println(count + "polled by "+user);
++count;
}
public int getCount()
{
return count;
}
}
But the polled gets called only once.
What is wrong here?
EDIT:
Hi all,
it seems i am so lame that i cant get ppr to work at all, leave poll alone.
I have uploaded archived eclipse project here, I am using JSF 2.0 and trinidad 2.0, jstl 1.2.
http://www.mediafire.com/?u35h0k65qh5ed71
its pretty much the same thing as described above.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,你的 tr:document 标签应该围绕整个文档:
用这种方式再试一次。
first of all your tr:document tag should be around the whole document:
Try again this way.
这个会很有趣,请查看
https://issues.apache.org/ jira/browse/TRINIDAD-1151
底线:从 jsp 页面中删除 CDATA 标记。
This one is going to be interesting, check this out
https://issues.apache.org/jira/browse/TRINIDAD-1151
Bottomline: Remove CDATA tags from your jsp pages.