我有一个使用JSF 2.1和PrimeFaces的项目.我试图使用简单的<h:outputText>引用#{myBean.matriz},我得到了这个错误:
SEVERE: javax.el.PropertyNotFoundException: ... value="#{myBean.matriz}": Missing Resource in EL implementation: ???propertyNotReadable???
Run Code Online (Sandbox Code Playgroud)
吸气剂是:isMatriz().应该是getMatriz()吗?
我需要在servlet的会话上创建一个倒计时,以便在X分钟到期时触发事件...
那么,有一种方法可以知道完成会话还剩多少秒?
我在ViewScope模式下有一个Managed Bean.因此,当我从此Managed Bean调用某个操作时,我的页面不会更新.我看到我的动作被很好地调用并返回null(viewscope工作流程正常).
那么,我做错了什么?
如果我使用Ajax重新渲染页面,它可以正常工作.
编辑:
我的版本是:
JSF 2.1.14与Primefaces 3.4.1
我的代码:
@ManagedBean(name = "test")
@ViewScoped
public class TestMB implements Serializable {
private String status;
public String getStatus() { return this.status; }
public void setStatus(String status) { this.status = status; }
public String changeStatus() {
this.status = "ViewScope Works!";
return null;
}
}
Run Code Online (Sandbox Code Playgroud)
我的页面:
<!DOCTYPE HTML>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
template="/template/ui.xhtml">
<ui:define name="head">
</ui:define>
<ui:define id="teste" name="content">
<h:form id="form">
<h:outputText id="status" value="OK?: #{test.status}" />
<p:commandButton id="myAction" value="Do it!" action="#{test.changeStatus}" …Run Code Online (Sandbox Code Playgroud) Primefaces 3.5 JSF 2.1
\n\nI\xc2\xb4m 使用 p:remoteCommand 执行异步命令并在页面加载后更新我的视图,但看起来在每次迭代结束时它会再次执行等等...
\n\n这种行为正确吗?
\n\n如何只执行一次p:remoteCommand?
\n\n更新
\n\n我已经检查过我的远程命令不在更新面板中,所以感谢您的回答,但已经可以了。我如何解决我的问题:
\n\n我不知道为什么,但使用 Omnifaces 的 onloadScript ( http://showcase.omnifaces.org/components/onloadScript ) 来调用它被调用多次的 RemoteCommand 函数,但使用 $(document).ready ...仅一次。所以,我改变了它,现在就可以使用了。
\n我正在使用JSF 2.1和Primefaces:
我有一个带有托管属性的视图作用域托管bean,以及一个在其他视图范围内的托管bean上设置内容并转发到引用该托管bean的其他页面的方法:
@ManagedBean
@ViewScoped
public class HelloMB {
@ManagedProperty("otherMB")
private OtherMB other;
public String changeOtherMB() {
otherMB.setAnyObject(new Object());
return "otherPage.xhtml";
}
}
@ManagedBean
@ViewScoped
public class OtherMB {
private Object o;
public void setAnyObject(Object o) {
this.o = o;
}
}
Run Code Online (Sandbox Code Playgroud)
因此,当渲染otherPage时o为null.
你知道我怎么能解决这个问题?如何在@ViewScoped托管bean中保留对象并将其保存在其他页面上而不使用@SessionScoped?
我正在尝试创建一个从多选复选框html组件接收参数列表的方法.但是,它不起作用.
我测试过:
@POST..
.. myMethod(@FormParam String [] myCheckboxAttribute)
.. myMethod(@FormParam List<String> myCheckboxAttribute)
Run Code Online (Sandbox Code Playgroud)
这些都不是很好(最后一个(列表)只有第一个复选框选中,但其他没有).
有些想法?
jsf ×2
jsf-2 ×2
view-scope ×2
boolean ×1
el ×1
getter ×1
java ×1
javabeans ×1
jersey ×1
jsp ×1
managed-bean ×1
multi-select ×1
primefaces ×1
rest ×1
servlets ×1
session ×1