Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Quercus

Reply
 
Thread Tools Display Modes
  #1  
Old 12-16-2013, 12:56 AM
adamMc adamMc is offline
Junior Member
 
Join Date: Dec 2013
Posts: 2
Default adding a java object/attribute outside of servlet

Hi,

We are using php for dynamic scripts, but we are doing so within out own REST framework, not using tomcat or resin. It is working great, but we need to be able to pass java objects to the php scripts, I know how to do this in the conext of a a servlet by passing an attribute, but I do no know how to do this outside of such a context. Here is some jaava code:

String myObject = "myObject";
phpFile = PekoeServer.workingDirectory + "/php/" + phpFile;
System.out.println("phpFile = " + phpFile);
engine.executeFile(phpFile);

>>> the above code works fine for executing the desired php script, but we want to pass he object myObject to the quercus engine. How do I do this? I looked for a setAttributte type method, but failed to find what I was looking for. Any ideas. Thanks.
Reply With Quote
  #2  
Old 01-04-2014, 08:04 AM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

Hi adamMc,

You should be able to use javax.script.Bindings to pass in Java values to your scripts. But it looks like Quercus doesn't use the Bindings. I've filed a bug report at:

http://bugs.caucho.com/view.php?id=5629
Reply With Quote
  #3  
Old 01-04-2014, 08:07 AM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

I stand corrected. Quercus does indeed use Bindings.

Bindings bindings = new SimpleBindings();
bindings.put("myObj", new MyObject());

engine.eval(str, bindings);
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:18 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.