myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Kurz <michi.k...@gmx.at>
Subject Re: el expression
Date Wed, 10 Feb 2010 08:33:56 GMT
Hi,

it is true that it is not possible to use method parameters or to call 
methods of an object that are no getters or setters (at least before 
Java EE 6).

But there are ways to bypass this limitation:

* If you only want to call a method in an EL expression you could define 
an EL function (possible with JSP and Facelets).

* If you want to pass a parameter to an action method you could use an 
alternative EL implementation like JBoss EL (see [1]). For this you have 
to include the JBoss EL libraries and replace the expression factory of 
MyFaces like this in your web.xml:

   <!-- Replace ExpressionFactory for Apache MyFaces -->
   <context-param>
     <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name>
     <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
   </context-param>

regards
Michael

[1]: 
http://docs.jboss.org/seam/2.0.1.GA/reference/en/html/elenhancements.html

Am 10.02.2010 09:20, schrieb Martin Monshausen:
> Hi,
> calling methods with parameters is not possible in JSF as far as I know. Try to set Parameter
in Bean before calling the method and then refer to it in your parameter-less method.
> Yours,
>
> Martin
> ________________________________
>
> Von: Krishna K. Pandit [mailto:Krishna.Pandit@aptuit.com]
> Gesendet: Mi 10.02.2010 06:14
> An: MyFaces Discussion
> Betreff: el expression
>
>
>
> Hi all
>
> Can any one can help me how to pass a parameter to a method while
> calling it in EL expression.
> Im trying this
>
> "#{myBean.method('JAVA')}
>
> But I m getting errors while rendering.
>
> Thanks
> Krishna Pandit
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify the sender by email
> reply and delete it from your system.
> The integrity and security of this email cannot be guaranteed on the Internet.
>
>
>
>

Mime
View raw message