if (myType.equals("receipt")) {
response.setContentType("application/pdf");
id = Long.valueOf(request.getParameter("id"));
Payment payment = paymentManager.get(id);
ReceiptFormatToPdf pdf = new ReceiptFormatToPdf();
pdf.write(payment, response.getOutputStream());
response.getOutputStream().close();