2 Replies Latest reply on Jan 22, 2013 7:44 AM by rahul22

    seam 3 + Expressions + ValueExpressions ??

    rahul22

      hi ,

       

      I'm working on migration from seam 2 to seam 3 .

       

      in seam 2 we have 2 classes named : Expressions and ValueExpression .

       

      in seam 3 these classes i can find easily but are different as following :-

       

      1. ValueExpression is not generic now .

      2. Expressions don't have a method createValueExpression .

       

      my code has something like this :-

       

      SEAM 2


      ValueExpression<Class_Name> demo =

                                    Expressions.instance().createValueExpression("#{Class_Name_Expression}", Class_Name.class);

       

      so how i can achieve this in seam 3 ???

       

      any suggestion will be helpful .

       

      Thanks

        • 1. Re: seam 3 + Expressions + ValueExpressions ??
          rahul22

          hi ,

           

          Till Now what i got for above expression in seam 3 is :-

           

          @Inject Expressions expression;

           

          ValueExpression demo=expression.getExpressionFactory().createValueExpression("#{Class_Name_Expression}", Class_Name.class);

           

          but now the issue is :-

           

          as in seam 2 ------------

           

          demo.getValue();

           

          as in seam 3 ------

           

          demo.getValue(expression.getELContext());

           

          so if i use above statement do i have to add ELContext arguement as -------------

           

          ValueExpression demo=expression.getExpressionFactory().createValueExpression(expression.getELContext(),"#{Class_Name_Expression}", Class_Name.class);

          ????????????

           

          Thanks


           


          1 of 1 people found this helpful
          • 2. Re: seam 3 + Expressions + ValueExpressions ??
            rahul22

            hi,

             

            Then following Expression can be done in following manner

             

            // AS IN SEAM 3 SOLDER , CREATE METHOD IS CALLED INTERNALLY

             

            ValueExpression demo=expression.evaluateValueExpression("#{Class_Name_Expression}", Class_Name.class);

             

            same for createMethodExpression .....

             

            Thanks!!