Code example for Gson

0
	} 
 
	protected String page2Json(HttpServletRequest request, Page<T> page) {
		Type type = new TypeToken<Page<T>>() {
		}.getType();
		return new Gson().toJson(page, type);
	} 
 
	// CRUD's D - 删除对象 
	public ActionForward delete(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception { 
		try { 
			this.getCrudService().delete(this.getEntityIds(request));
			response.getWriter().print(
					"{\"success\":true,\"msg\":\"delete success!\"}"); 
		} catch (Exception e) {
			if (logger.isInfoEnabled())
				logger.info(e.getMessage(), e);
			response.getWriter().print(