commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim O'Brien" <tobr...@discursive.com>
Subject RE: [EL] Docs ?
Date Sat, 25 Jun 2005 23:05:22 GMT
EL is meant to be used in a JSP 2.0 environment.  You can get everything you need form Commons
JEXL.  

Here is some code for you:

import org.apache.commons.jexl.Expression;
import org.apache.commons.jexl.ExpressionFactory;
import org.apache.commons.jexl.JexlContext;
import org.apache.commons.jexl.JexlHelper;

SomeObject thingy = new SomeObject();
thingy.setFoo( "Blah" );

String expr = 
    "JEXL let's you do everything you'd do with EL. ${thingy.foo}";

Expression e = ExpressionFactory.createExpression( expr );
JexlContext jc = JexlHelper.createContext( );
jc.getVars( ).put("thingy", thingy);
String message = (String) e.evaluate(jc);

System.out.println( message );


Does that help?


-----
Tim O'Brien
tobrien@discursive.com
(847) 863-7045  

> -----Original Message-----
> From: Jörg Schaible [mailto:Joerg.Schaible@Elsag-Solutions.com] 
> Sent: Friday, June 24, 2005 11:51 AM
> To: Jakarta Commons Users List
> Subject: [EL] Docs ?
> 
> Hi folks,
> 
> looking at commons-el I wonder, how I can use it in a 
> standalone app. Unfortunately there are no docs how to 
> inialialize anything. In particular, the "particularly" 
> mensioned package overview does also not contain any 
> addtitional docs, in the repository is no package.html. Also 
> I cannot see any examples.
> 
> How to proceed?
> 
> - Jörg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
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