I'm very confused as to what you're trying to achieve. This is server-side, 
yeah? Isn't Jackson's purpose to convert between Java objects and JSON? Are you 
wanting to pass JSON to client-side? What's the name of the client-side 
JavaScript module? Does it expect parameter(s)? What type? (You can pass 
JSONObject, Boolean, Number, String, JSONArray, JSONLiteral, JSONObject, 
JSONString, as the exception message says.) How will you convert from Jackson's 
output to one of those types? Maybe you could use ObjectMapper#writeValue(...) 
as input to JSONLiteral, pass it to the client-side, and the module could parse 
it to JSON?

JavaScriptSupport#require(String moduleName) returns an Initialization.
Initialization#with(Object... arguments) expects the types noted above. The 
number of args has to match the number of args client-side.

See 
http://people.apache.org/~hlship/t5api/apidocs/org/apache/tapestry5/services/javascript/JavaScriptSupport.html#require(java.lang.String)

But all of this begs the question, is this heading in the right direction?

HTH,

Geoff

On 08/03/2014, at 7:55 AM, George Christman wrote:

> Hi guys, I'm trying to use Jackson directly with
> javascriptsupport.require.with() like so
> 
> ObjectMapper mapper = new ObjectMapper();ObjectNode node =
> mapper.valueToTree(pojo);
> 
> javascriptsupport.require.with(node);
> 
> 
> However I get the following exception
> 
> JSONObject properties may be one of Boolean, Number, String,
> org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONLiteral,
> org.apache.tapestry5.json.JSONObject,
> org.apache.tapestry5.json.JSONObject$Null,
> org.apache.tapestry5.json.JSONString. Type
> org.codehaus.jackson.node.ObjectNode is not allowed. -
> 
> I can't seem to find the API on require, does anybody know how I could use
> jackson directly without having to first convert my Jackson object to a
> string and then pass it into JSONObject?
> 
> Thanks,
> 
> -- 
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to