Struts 2 PDF Download

Struts 2 PDF Download

There are many ways you can generate PDF report in java. Here you will see easiest way to generate PDF report. To create PDF we have used itextpdf API for java and attached generated report in response to the user so that he can view/download PDF file locally.

Please see previous tutorial to create report in below format:

  • Create maven project name: Struts2PDFDownload below is final project structure:

Struts 2 PDF Download

  • pom.xml:

  • ApplicationResources_en.properties:

  • CreatePDFStruts2.java:

  • Struts2PDFDownloadAction.java:

  • index.jsp:

  • You could run this project on any server. Below will be output:

Struts 2 PDF Download

Struts 2 PDF Download

Struts 2 PDF Download

  • Fork your own copy of project from GitHub

download  Download Project: Struts2PDFDownload

Leave a Reply

Your email address will not be published. Required fields are marked *