commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pascal LAVAUX \(Yahoo\)" <plav...@yahoo.fr>
Subject [JEXL] Execution difference between Expression and Script
Date Wed, 11 Oct 2006 15:03:04 GMT
Hi all,

I'm curently  testing JEXL 1.1 for my project and I can't get the Class Script 
working.

When I test the same Jexl code with an Expression it works fine, with a Script 
it does nothing.

[CODE]
  String jexlCode = "resultat.setCode('OK')";
  Expression e = ExpressionFactory.createExpression(jexlCode);
  Script s = ScriptFactory.createScript(jexlCode);

  CodeLibelle resultatJexl = new CodeLibelle();
  JexlContext jc = JexlHelper.createContext();
  jc.getVars().put("resultat", resultatJexl);

  resultatJexl.setCode("");
  e.evaluate(jc);
  out.println("Resultat =" + resultatJexl.getCode());
  resultatJexl.setCode("");
  s.execute(jc);
  out.println("Resultat =" + resultatJexl.getCode());
[/CODE]

The output is:
Resultat=OK
Resultat=

Have anybody an idea?

    Thanks,
-------------------------------------------------------
Pascal LAVAUX                    Responsable Technique
TRIANGLE Informatique              www.triangle-i.com
------------------------------------------------------- 


	

	
		
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Demandez à ceux qui savent sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com

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