Excel file download in Struts2 using apache POI

Apache POI is a project by Apache Software Foundation. It provides the Java API for Microsoft Documents.

You can find out more about Apache POI. You can also download apache POI from here.

how to save xls file in java struts2

Here we are explaining how to export data from struts2 action to an XML file.
For that, we are using apache poi.


We have included the following jar files in the lib folder

struts.xml file configuration to download xls file in java struts2

In struts.xml

In jsp