Just some sharing about java open source and life

JSF1.2中 ValueExpression的用法

日期:2010-06-06 20:21 | 作者:JavaChen | 分类目录:JSF
156 views

JSF1.2中 ValueExpression的用法

/**
* Method for taking a reference to a JSF binding expression and returning
* the matching object (or creating it).
* @param expression EL expression
* @return Managed object
*/
public static Object read(String expression) {
FacesContext context = FacesContext.getCurrentInstance();
ELContext elContext = context.getELContext();
ValueExpression ve = context.getApplication().getExpressionFactory()
.createValueExpression(elContext ,
column.getProperty(), Object.class);
if(ve == null) return null;
return ve.getValue(elContext);
} 

public void before(String var) {
FacesContext context = FacesContext.getCurrentInstance();
ELContext elContext = context.getELContext();
ValueExpression ve1 = context.getApplication().getExpressionFactory()
.createValueExpression(elContext,
"#{" var "}", Object.class);
ve1.setValue(elContext, data);
}
作者:JavaChen | 分类目录:JSF | 标签:
回到顶部

无觅相关文章插件,快速提升流量