response.setContentType("application/json");
response.getWriter().print(jsonObject.toString());
}
public static void respons2JsonArrayHibernate(HttpServletResponse response, Object json) throws IOException {
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setExcludes(new String[]{"delegate"});
jsonConfig.setExcludes(new String[]{"transactionTimeout"});
jsonConfig.registerJsonBeanProcessor(org.hibernate.proxy.HibernateProxy.class, new HibernateJsonBeanProcessor());
jsonConfig.setJsonBeanProcessorMatcher(new HibernateJsonBeanProcessorMatcher());
JSON jsonObject = JSONSerializer.toJSON(json,jsonConfig);
response.setContentType("application/json");
response.getWriter().print(jsonObject.toString());
}