I am trying to output an Excel file as the view in Spring Roo 1.0.2
What is the quickest way to do this?
(Do I have to add new mapping etc?) At the moment I am using the default Roo AjaxUrlBasedViewResolver.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think there’s a specific “Roo” way of doing this, but Spring MVC does have an AbstractExcelView class that uses Apache POI and doesn’t cause any problems – I think it’s the best you can hope for.
First create a view class that extends AbstractExcelView and implements the buildExcelDocument method:
Then add the following to your webmvc-config.xml. I don’t think the position matters, but I have it below the section where my TilesConfigurer is listed:
Finally create views-excel.xml with the following in it: