Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

download html file  RSS feed

 
Vijay Vaddem
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would like to give the option of downloading the generated html page (from JSP) to the user with a link.

Can anyone let me know the steps to be followed....


TIA..


Vijay
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36463
464
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay,
The link itself is easy. It's just a get request to a jsp. To download, you need to call the following before your JSP output:

response.setHeader ("Content-Disposition", "attachment; filename=\"file.html\"");
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!