Kettle: current browser environment doesn't send HTTP body

Svetoslav Nedkov snedkov at asteasolutions.com
Thu Dec 10 17:12:19 UTC 2009


Dear Kettle users,

The last couple of days I investigated a problem consisting of payload 
data not being sent when doing an ajax request through jQuery.
Finally I came to  the reason for this as can be seen in this posting:

http://old.nabble.com/env.js%27s-XMLHttpRequest-won%27t-add-message-content-to-outgoing-HTTP--POST--fix-included--td21679482s27240.html

The problem is that ajax calls through jQuery use the XMLHttpRequest 
object which exists for all modern browser but is supplied by a third 
party javascript for Rhino. This javascript called env.js in the version 
we are using doesn't send any payload through the connection - it writes 
out the HTTP headers and then jumps to read the response. The intention 
behind such an implementation could be that XMLHttpRequest is supposed 
to handle only GET requests, which don't have payload.

I'm supplying a patch that fixes this problem and works for the example 
I am running:

http://issues.fluidproject.org/browse/ENGAGE-213

We could also consider switching to a more recent version of env.js, but 
as Antranig pointer there are too many files that need to be integrated 
in Kettle to do so.
There is also a single file especially for Rhino called env.rhino.js, 
but when Rhino tries to compile it there is an exception stating that 
the method bytecode is more than 64K long. There is a possibility to 
turn compiling off and switching to interpretation mode, but I faced 
some problems with undefined variables there. So further investigation 
is needed if we decide to go this way. I have a guess that env.rhino.js 
will be interpreted correctly if using the Rhino distribution included 
in the env.js package, but we are using a later version and I'm sure 
that this is for some reason.

I'd like to hear your opinion on this one - should we keep our old 
version of env.js or try to use the latest.


Regards,

Svetoslav






More information about the fluid-work mailing list