1 Reply Latest reply on Sep 30, 2009 11:35 AM by niox.nikospara.yahoo.com

    Process EL Expression

    benitojuarez

      Hello,


      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.


      grz,
      BJ

        • 1. Re: Process EL Expression
          niox.nikospara.yahoo.com

          Hi,


          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.