This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Spring and the fly likes How to set Jexcel name in Spring mvc? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "How to set Jexcel name in Spring mvc?" Watch "How to set Jexcel name in Spring mvc?" New topic
Author

How to set Jexcel name in Spring mvc?

Tanathip Viriya
Greenhorn

Joined: Mar 17, 2010
Posts: 5
I'm following with mkyong Jexcel with Spring tutorial and everything looks fine.it can create excel file and write sheet except one thing is I can't change my excel file name? It will display file name same as my link to controller.

Here is example


It will always create excel file name "report.html.xls". Anyone know how to change file name??

This is my controller

and buildExcelDocument method


According from my code, It will display report.xls(In IE) and report.html.xls (In firefox).
Thank in advance, Mart
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

I think it assumes the name of the html file you give below:-

href="report.html"


===Vyas Sanzgiri===
My Blog
Tanathip Viriya
Greenhorn

Joined: Mar 17, 2010
Posts: 5
Vyas Sanzgiri wrote:I think it assumes the name of the html file you give below:-

href="report.html"


Thank for answering my question.

My solution is:

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to set Jexcel name in Spring mvc?