We Recommend

Java How to Program Java How to Program
Takes a new tools-based approach to Web application development that uses Netbeans 5.5 and Java Studio Creator 2 to create and consume Web Services. Features new AJAX-enabled, Web applications built with JavaServer Faces (JSF), Java Studio Creator 2 and the Java Blueprints AJAX Components. Includes new topics throughout, such as JDBC 4, SwingWorker for multithreaded GUIs, GroupLayout, Java Desktop Integration Components (JDIC), and much more.


Posted By

yoshimov on 08/28/06


Tagged

java groovy


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

gwmccort


Execute Groovy from Java


Published in: Java 


setPropertyしたオブジェクトは、Groovyから宣言済みの変数として参照できる。

  1. GroovyShell shell = new GroovyShell();
  2. Script script = shell.parse(new File(SCRIPT_FILE));
  3. script.setProperty("score1", score1);
  4. script.setProperty("score2", score2);
  5. Object ret = script.run();

Report this snippet 

You need to login to post a comment.