• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with a filter to alter a gif in the response

 
G Roberts
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to intercept a gif on its way from a servlet to the browser, so I've got a Filter working, which is called, and which successfully draws on the image and sends it to the response output stream, except that the end of the gif is corrupt. The filter can write the gif out to the filesystem without corrupting it so I know the problem is with my misunderstanding of Filters.

I can see the same thing happening in the example below. It succesfully adds "<HR>PRE<HR>" to the finished page, but for then fails to send the last 11 characters of the file being filtered. It's as if the response stays the same length even though the filter adds stuff to it.

Any ideas? It must be something pretty stupid!

Thanks in advance.

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Are you trying mix HTML with the binary data from the image?
 
G Roberts
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Sorry, my posting was not as clear as it should have been. I have this problem with an image modifying servlet, but I also have the same symptom with the much simpler PrePostFilter example.

So, this question only concerns outputting html. I also forgot to say that the html appended after the original output never appears.

Any more ideas welcome because this one is driving me nuts.

G.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic