try this: cx.getWrapFactory().setJavaPrimitiveWrap(false);
Where "cx" is your Context reference. This tells Rhino to convert String, Number, Boolean and Character into their JavaScript equivalents when returning from a Java function ---------------------------------------------------------- Mark Porter Myna JavaScript Application Server Easy server-side JS on a Java platform http://www.mynajs.org On Mar 17, 9:19 am, wolffiex <[email protected]> wrote: > hi list, > When I do this: > request = ...//java servletrequest object > var s = request.getParamter("p"); > > I want s to be a javascript string, not a java string. I want typeof s > == "string", not object. > > A number of posts suggest that I want to implement something like > PrimitiveWrapFactory to do > this:http://mxr.mozilla.org/mozilla/source/js/rhino/examples/PrimitiveWrap... > > I've installed a wrap factory like this and verified that it is > (sometimes) called, but it doesn't appear to be invoked when, I say, > call getParameter on a java servlet request object. Can someone give > me a hint about what I'm doing wrong? Thanks, > A _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
