You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2010/02/10 10:48:59 UTC

[Myfaces Wiki] Update of "Parameters_In_EL_Functions" by MarkStruberg

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The "Parameters_In_EL_Functions" page has been changed by MarkStruberg.
http://wiki.apache.org/myfaces/Parameters_In_EL_Functions?action=diff&rev1=7&rev2=8

--------------------------------------------------

  However when using JSF1.1/JSP2.0, there is no direct support for user-defined functions or parameters. There are a couple of ways of doing this, however:
   1. If you are willing to use a !MyFaces-specific solution then a custom !FunctionMapper can be registered.
   2. A portable (but less flexible) solution is to take advantage of the fact that EL supports Maps: when evaluating "foo.bar" or "foo['bar']", if foo is a Map then foo.get("bar") is invoked. It is therefore possible to write a method that takes a single parameter by implementing that method as the get(key) method of a Map.
+ 
+ It get's even better with EL-2.2 which is part of [[http://jcp.org/aboutJava/communityprocess/mrel/jsr245/index.html|JSR-245 MR2]]. In EL-2.2 you can also pass parameters to managed beans, even without the need of having static methods. See HowToEnableEl22 for a quick tutorial on how to make EL-2.2 available in Tomcat6 and Jetty6.
  
  == FunctionMapper Solution ==