Hi all,
I wonder which area do i need to research on for this problem.
Right now i want to invoke some javascript function in the java
program.
For e.g.
String result = evalExpression(" "Hello World".toUpperCase() ");
public String evalExpression(String javascript){
evaluate the javascript string and return the result
}
Appreciate any advice
oulan bator - 05 May 2006 10:36 GMT
hi, have a look at Rhino at Mozilla's ! or at BSF (at apache's)
Good luck
Roedy Green - 05 May 2006 23:22 GMT
>String result = evalExpression(" "Hello World".toUpperCase() ");
Java has no eval, but I think JPython does, and possibly Ruby. You
could use on-the-fly compilation to cook one up for Java.
see http://mindprod.com/jgloss/eval.html
see http://mindprod.com/jgloss/onthefly.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.