If it's a no parameters method, you can still call it using the a map

create a manager Bean that implements Map methods
Create the appropriate conde inside get(key) so that you can now make
this in EL:
staticAccessorBean['com.package.MyClass.methodName']
It's ugly but somehow trivial.

Other way it to play with EL specification that allows you to add
functions inside it. But you will need quite a few readings before
achieving it without facelets.

En l'instant précis du 01/04/07 13:53, Madhav Bhargava s'exprimait dans
toute sa noblesse:
>
> Hi All,
>
>  
>
> I need to call a static method on an arbitrary java class. Is it
> possible using EL in its current form?
>
>  
>
> There is a way in which I can call – make the class a managed bean.
> Call the static method on the managed bean instance. This is a
> horrible approach because:
>
>    1. Static methods should not be called on instances of the same class.
>    2. It means that I will have to make any java class a managed bean,
>       even if I do not want to make it.
>
>  
>
> Is there any other way in which I can achieve this?
>
>  
>
> Rgds,
>
> Madhav
>
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely for the use of the addressee(s). If you are not the intended
> recipient, please notify the sender by e-mail and delete the original
> message. Further, you are not to copy, disclose, or distribute this
> e-mail or its contents to any other person and any such actions are
> unlawful. This e-mail may contain viruses. Infosys has taken every
> reasonable precaution to minimize this risk, but is not liable for any
> damage you may sustain as a result of any virus in this e-mail. You
> should carry out your own virus checks before opening the e-mail or
> attachment. Infosys reserves the right to monitor and review the
> content of all messages sent to or from this e-mail address. Messages
> sent to or from this e-mail address may be stored on the Infosys
> e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>

Reply via email to