1 Reply Latest reply on Sep 30, 2009 11:35 AM by Nikos Paraskevopoulos

    Process EL Expression

    Benito Juarez Newbie


      is it possible to process an el expression like myBean.doIt('argument') directly in java code? I'd like to avoid parsing the string myself.


        • 1. Re: Process EL Expression
          Nikos Paraskevopoulos Novice


          You mean invoke a method expression or get/set the value of a value expression? If so it is possible. You need the javax.el.ELContext and the javax.el.ExpressionFactory. Both can be obtained from the FacesContext. Then call createMethodExpression() or createValueExpression() on the ExpressionFactory.

          It is trickier if you don't have a FacesContext, i.e. outside a JSF request, but it is still very possible.

          I'd be happy to provide you with more details.