All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webframe.web.springmvc.bean.AjaxError Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
/*
 * com.berheley.bi.basic
 * Created on 2011-12-4-上午10:23:58
 */

package org.webframe.web.springmvc.bean;

import net.sf.json.JSONObject;

/**
 * Ajax 错误信息
 * 
 * @author 黄国庆 
 * @since 2012-1-30 上午08:30:16
 * @version
 */
public class AjaxError extends AjaxJson {

	private JSONObject	error	= null;

	public AjaxError() {
	}

	public AjaxError(JSONObject error) {
		this.error = error;
	}

	public AjaxError putError(String key, String error) {
		createError();
		this.error.put(key, error);
		return this;
	}

	protected JSONObject createError() {
		if (this.error == null) this.error = new JSONObject();
		return this.error;
	}

	@Override
	public String toString() {
		createError();
		putMsg("error", error);
		return super.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy