Would it be easier if you just did a:

PrinterWriter out = resp.getWriter();
out.println(json.toJSONString());

?

On Sun, Mar 14, 2010 at 11:36 PM, Philip Tucker <[email protected]> wrote:
> I have a servlet that returns a JSON string. For some reason it works
> fine when I dispatch to a JSP, but sometimes fails when I write
> directly to the response.
>
> this works:
>
>          req.setAttribute("json", json.toJSONString());
>          req.getRequestDispatcher("json.jsp").forward(req, resp);
>
> this (sometimes) doesn't work:
>
>          json.writeJSONString(resp.getWriter());
>
> Unfortunately the error is sporadic and I'm not reproducing right now,
> but it was an "Illegal argument" exception in NucleusJDOHelper.
>
> The request is reading and writing to persistence. I'm calling
> PersistenceManager.close() immediately after this.
>
> Any ideas? I can provide more details if necessary.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>



-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to