How to access Java object from a script?
This example demonstrate how you can access Java object from a script. We put Java object into the script engine by calling the
put(String key, Object value) method. This value can later be read or access by our script. For example we pass an array of string and a date object for our script to display.
Our code will print as follow:
Today is Mon Jul 13 23:12:19 SGT 2009