Struts 2 XML Download

Struts 2 XML Download

In this demo you will see how to create XML report on server side and send XML response back to the client so that he could view/download report in his local system. To keep this demo easy to understand I have created XML using core java API but it is up to you to use any third party or other java API to create XML file write content in response.

Please see previous tutorial to create report in below format:

  • Create maven project Struts2XMLDownload in eclipse or you could download from bottom and import in eclipse. Below if final project structure:

Struts 2 XML Download

  • pom.xml:

  • ApplicationResources_en.properties:

  • Struts2XMLDownloadAction.java:

  • index.jsp:

  • Download and run this project on any server below will be output:

Struts 2 XML Download Struts 2 XML Download Struts 2 XML Download

  • Fork out your own copy from GitHub

download  Download Project: Struts2XMLDownload

Leave a Reply

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