반응형
package com.company.aa;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.json.JSONObject;

public class JsonAPI {

	public void flushJson(Object json, HttpServletResponse response) throws IOException {
		
		// 출력
		response.setContentType("application/json; charset=UTF-8");
		PrintWriter writer = null;

		writer = response.getWriter();
		writer.print(json);
		writer.flush();
	}
	
}
반응형