commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <rahul.akol...@gmail.com>
Subject Re: [SCXML] add custom FunctionMapper to EL for string manipulation functions
Date Tue, 27 Jun 2006 06:59:07 GMT
On 6/21/06, Mike Sparr - www.goomzee.com <mike@goomzee.com> wrote:
> Does anyone have example usage of ELEvaluator(FunctionMapper)?  I downloaded
> JSTL 1.1 and going through library but few examples on how to implement.
>
> Goal is to add some more functions with EL (like substringAfter,
> substringBefore, tokenize(var,delim), etc.).
>
<snip/>

See roughly halfway through this post from last week:

http://marc.theaimsgroup.com/?l=jakarta-commons-user&m=115074442229754&w=2

What worked, what didn't? I'd have written out a complete example if I
had more time today.


> Also, the commons ELEvaluator references deprecated FunctionMapper as noted
> in Sun's documentation:
>
> " Please note that as of JSP 2.1, all classes and interfaces that were in
> package javax.servlet.jsp.el have been deprecated in favor of the new
> unified Expression Language APIs (javax.el). See the Expression Language
> specification document for more details.
>
> While a JSP container must still support the deprecated APIs defined in
> javax.servlet.jsp.el, developers should only rely on the new javax.el APIs
> for new development work. "
>
<snap/>

Yes, JSP 2.0 EL (the one in the [scxml] examples) and JSP > 2.0
(unified) EL has numerous changes. To use unified EL in SCXML
documents, the appropriate Context and Evaluator implementation will
probably need to be authored, but thats only relevant if your web-app
is already using 2.1.

-Rahul


> ====
>
> Ideal functionality when scripting SCXML doc:
>
> <var name="foo" expr="First Last Email"/>
> <var name='fooTokens' expr='${tokenize(foo," ")}'/>
>
> <first-name>${foo[0]}</first-name>
> <last-name>${foo[1]}</last-name>
> <email>${foo[2]}</email>
>
> ====
>
> OR, when using VXML 2.0 builtin grammar for currency, when user says
> "dollars" the value passed is prefixed with USD (e.g. "20 dollars" is passed
> as "USD20").  It would be helpful to have some string manipulation functions
> like substringAfter("USD20","USD") to parse out the 20.
>
> ====
>
> If anyone knows how to add the FunctionMappers or best way to implement the
> above 2 cases minimum, I'm all ears.  :)
>
> Tx,
>
> Mike
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message