我使用的是SWF (Spring WebFlow) 2.2和JSF2.0.4。
在flow.xml中,我将变量设置为SpringWebFlow的requestScope。
<set name="requestScope.RE_RENDER_TABLE" value="true" type="java.lang.Boolean" />但是,我需要在使用FacesContext的JSF中使用这个变量。我尝试了以下方法,但两种方法都返回null。
FacesContext.getCurrentInstance().getExternalContext().getRequest();
FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("RE_RENDER_TABLE");如何在JSF上下文中的flow.xml文件中添加requestScope变量?
发布于 2013-02-15 03:22:25
在xhtml中尝试
#{requestScope.RE_RENDER_TABLE}或者,在支持bean中:
FacesContext getFacesContext() {
return FacesContext.getCurrentInstance();
}
ELContext elc = getFacesContext().getELContext();
ExpressionFactory ef = getFacesContext().getApplication().getExpressionFactory();
ef.createValueExpression(elc,"#{requestScope.RE_RENDER_TABLE}",Boolean.class).getValue(elc);发布于 2014-11-05 18:43:41
或者尝试简单的#{RE_RENDER_TABLE} (在所有范围内)。
https://stackoverflow.com/questions/5233398
复制相似问题