all data exchange between the Java code and
the executed script should be done through primitive variables, strings, and Java
objects (for example, beans) whose properties and methods can be accessed very easily in the
JavaScript code. Simply said, don't try to access native JavaScript objects in your
Java code. Use Java objects in the JavaScript code instead.