jeudi 14 mai 2015

How to handle exceptions when using Spring AbstractExcelView to generate an Excel document

I have an application where I am generating a report (Excel sheet) based on the criteria selected by the user.

Here is the flow:

  • User selects some criteria from the criteria selection page (form)
  • Clicks on "Generate Report" button

The application queries the database and generates an excel sheet with the data for the output directly and there is no intermediate page in between.

I am using "AbstractExcelView" to generate the excel sheet. I have not been able to figure out a way to handle the exceptions that may be thrown by the "AbstractExcelView" while trying to generate the Excel document. (My intention is to provide the user with some feedback by showing a popup/error message on the criteria selection page itself)

Pardon my not so deep knowledge of Spring MVC if this looks too elementary to you. I tried searching for resources on the web but could not find a solution.

Any pointers will be greatly appreciated !

Aucun commentaire:

Enregistrer un commentaire