This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
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

HTML Content being added when File download is written to response

 
surya naidu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a servlet in which I want to download a file at the end
I have code which gets the response and writes a Bytearray to the response
I am able to Download the file which is written,However there is some HTML content being appended at the end.
The HTML content which is being appended is the header and footer of the application
Is there anyway i can filter out this data,Any suggestion?
 
Tim Moores
Bartender
Posts: 2687
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The solution isn't to remove that HTML, the solution is to not send it in the first place. You need to ensure that file downloads are not being being handled the same way as page requests, i.e. that no header and footer is sent for them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic