Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in HTTPServletResponse

 
Thirugnanam Saravanan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have tried this code from Head First book ( Chapter 4 ) to implement the jar download functionality in servlets. The code is working fine, but while downloading the file,it is not getting downloaded as jar file( with .jar extension). Instead it is getting downloaded as a file with unknown filetype. What's wrong with this code? What should I do to implement my code in such a way that, when i download, it should be downloaded as a .jar file? Any Ideas?



[ November 18, 2008: Message edited by: Thirugnanam Saravanan ]
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try adding this to the code before writing the response to output stream.



[ November 18, 2008: Message edited by: Amol Nayak ]
 
Thirugnanam Saravanan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now it is working fine as per my expectation. Thank you so much for the reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic