I made a PDF in a java class that I want to be downloadable from the browser. I searched some solution online and I found the "servlet solution" but I don't understand how it works, what are request and response, how I generate them and how I can call the protected method. It would be nice if you can help me.
this is the method that generate the PDF (it works)
public void creaPDF(Persona p) throws IOException, DocumentException {
Document doc=new Document();
PdfWriter.getInstance(doc, new FileOutputStream("/."));
doc.open();
PdfPTable table=new PdfPTable(1);
table.addCell(p.getCognome());
table.setHeaderRows(1);
doc.add(table);
doc.close();
}
This is my first experience with jsp, servlet and all the other stuff, be patience.