package controller.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.bean.VaccinationRecordHolder;
import model.bo.VaccinationRecordBO;

import com.google.gson.Gson;

/**
 * Servlet implementation class ShowVaccinationRecordServlet
 */
@WebServlet("/ShowVaccinationRecordServlet")
public class ShowVaccinationRecordServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ShowVaccinationRecordServlet() {
        super();
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		VaccinationRecordBO vaccinationRecordBO = new VaccinationRecordBO();
		String vaccinationRecordIdStr = request
				.getParameter("vaccinationRecordId");
		int idUser = -1, idVaccine = -1, dose = -1;
		if (vaccinationRecordIdStr != null) {
			String[] vaccinationRecordId = vaccinationRecordIdStr.split(";");
			idUser = Integer.parseInt(vaccinationRecordId[0]);
			idVaccine = Integer.parseInt(vaccinationRecordId[1]);
			dose = Integer.parseInt(vaccinationRecordId[2]);
		}

		VaccinationRecordHolder vaccinationRecordHolder = vaccinationRecordBO
				.getVaccinationRecordHolderById(idUser, idVaccine, dose);

		String json = new Gson().toJson(vaccinationRecordHolder);

		System.out.println("json " + json);
		response.setContentType("application/json");
		response.setCharacterEncoding("UTF-8");
		response.getWriter().write(json);
	}

}

@@ -1674,17 +1674,16 @@
 %5D);%0A%09%09%7D%0A
-%0A
 %09%09Vaccin
@@ -1808,17 +1808,16 @@
  dose);%0A
-%0A
 %09%09String
@@ -1871,47 +1871,8 @@
 er);
-%0A%0A%09%09System.out.println(%22json %22 + json);
 %0A%09%09r

Remove log