ITeye博客

methodbinding methodexpression valueexpression

feidaodalian · 2009-10-17 16:20 · jsf · Markdown


1. create MethodBinding MethodBinding methodBinding = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{bean.method}", null); 

2. create MethodExpression 
        ExpressionFactory expFactory = FacesContext.getCurrentInstance(). 
            getApplication().getExpressionFactory(); 
        ELContext elContext = FacesContext.getCurrentInstance().getELContext(); 
        MethodExpression expression = expFactory.createMethodExpression(elContext, "actionName", String.class, new Class[]{}); 

        commandComponent.setActionExpression(expression); 

3. create ValueExpression 
   ValueExpression valueExpression = expFactory.createValueExpression(elContext, "#{bean.value}", String.class); 

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。