`

create MethodBinding MethodExpression ValueExpression

    博客分类:
  • JSF
阅读更多
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);
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics