I posted this message to the BSF lists with "0" response. I 'm hoping maybe someone who is using BSF in the Jelly taglibrary might be able to shed some light on my issue, thanks.


I'm using BSF in a method of a class kinda like this:

public class Test{

protected BSFManager manager = null;

protected double value;

public Test()throws BSFException{

manager = new BSFManager();

manager.declareBean("this",this, this.getClass());
}

public Object myMethod(String script) throws BSFException{

BSFEngine engine = manager.loadScriptingEngine("javascript");

return engine.eval("my_generated_method",0, 0, script);

}

public void setValue(double value){
this.value = value;
}

public double getVlaue(){
return value;
}
}

this idea is that I could write script that looks very much like java
code that would normally go into "myMethod". However, it appears that
words like "this" and "super" are reserved words in BSF/Javascript. Is there anyway I can
get "this" to "reference the object instance of this class in my scripts?

I.E. I want a javascript that looks something like this to run an object
instance of this class.

{
this.setValue(0.04322*100);
this.getValue();
}

Is there a means to define a reference to "this" as available in the BSF ObjectRegistery?

Thanks
-Mark Diggory


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to