Scriptable thisObj, Object[] args) {
try {
HttpServletResponse response = Client.getCurrentObjectResponse().getHttpResponse();
response.setContentType("application/json; locator=id; charset=UTF-8");
Writer writer = new OutputStreamWriter(response.getOutputStream(),"UTF8");
new JSONSerializer().serialize(args[0], Client.getCurrentObjectResponse(), writer);
writer.flush();
return null;
} catch (IOException e) {
throw new RuntimeException(e);
}