the eval in webclient procude different behaviour between two servers:
Server Dev
JDK Information
java.vm.name=Java HotSpot™ Client VM
java.vm.version=11.0-b16
java.vm.info=mixed mode, sharing
java.vm.vendor=Sun Microsystems Inc.
Operating System Information
os.name=Windows 2003
os.version=5.2
os.arch=x86
Everything is ok
Prod Server
JDK Information
java.vm.name=Java HotSpot™ Client VM
java.vm.version=11.3-b02
java.vm.info=mixed mode, sharing
java.vm.vendor=Sun Microsystems Inc.
Operating System Information
os.name=Windows 2003
os.version=5.2
os.arch=x86
I’ve got couldn’t eval the string …
See my case 217097. I added some coding how I tried to eval.
I use eval() in several ways:
str = 'globals.myMethod'
if (eval(str)) // To test if method exists
{
eval(str)(args)
}
But also
str = 'globals.myVar'
if (eval(str) == 1) // To test if this variable has value 1
And also
str = 'globals.myVar'
if (some test)
str += ' = 1'
else
str += ' = 2';
eval(str) // Set variable to 1 or 2
And also
str = 'globals.myVar'
if (some test)
str += ' [1]'
else
str += ' [2]';
str += ' = 3'
eval(str) // Give some array value the value 3
Of course these example are quite simple, but it shows the way eval() is used. I worked fine in 3.5 and some of the coding was originally written in 2.2!
By the way, I tried also the following and that is working, so it looks like it is perhaps eval() in combination with if-statement
str = 'globals.myVar'
val = eval(str)
if (val == 1) // To test if this variable has value 1
function test()
{
var name = "called"; // arguments[0];
var argument = "from test";
this[name](argument);
}
function called()
{
application.output("called with argument: " + arguments[0])
}