• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding compression on the reponse

 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,
i just read the chapter 13 about filters. the last bit of the chapter explains how to use wrapper class to generate a custom reponse objects to which a servlet may write. my question is in the real world, do you really neew to compress the data like this? i mean isn't it really the web servers reponsibility of handling the load? is this compression technique really implemented in the real world? the code to implement is kind of hard to remember to (although it is not on the exam). any comments will be much appreciated.

thank you

Dinuka Arseculeratne
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey man
just chill
why do you want to your head over it ?
there are lots and lots and lots of things in the book that you can take pain of thinking
but i do agree that your question is proper.

what i would say is - "what if i want only some part of my respose to be compressed " in such cases you can use such code.i do remember having read such similar code in Marty Hall's book.
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have seent the idea of using compression to demonstrate filters in several places (I think there is even some sample code that comes with tomcat) and I agree that it is probably something that you would want to do on the server itself. Not only that, it does not seem to be a particularly good example as there is no obvious difference to see when the filter is working or not working on a typical home machine.

For this reason I came up with a demonstration of filtering that acts to filter out words sent via tht post method in an HTML form. The idea is that you might want to prevent spamming in a forum with V*agra ads. It also illustrates the idea of using the wrapper classes.

You can see the code at
http://www.examulator.com/moodle/mod/resource/view.php?id=427
 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you evey one for you comments and advice. i now understand the real use of filters.

thank you again.

Dinuka Arseculeratne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic