• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compression Filter

 
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.

I'm studying chapter 13 from HF Servlets and JSP and I'm trouble with the Compression Filter example.
I've written all the code for this example (regarding the Errata for HF Servlets And JSP).

When requesting the most pages (either via servlet's URL pattern or directly JSP) I got no problems.
But when I try to call a specific Servlet all I get on the browser is a blank page.

This is the code of my Servlet:



Did anybody here already see this kind of problem?
Any ideas?

Thanks in advance.
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Adolfo,

Did you try adding the HTML codes in your Servlet, like this:
If that doesn't work, please post your web.xml and the URL you are using to access the Servlet.

Regards,
Frits
 
Adolfo Eloy
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Frits. Thanks for replying. I've tried what you post, but no success...
Instead of posting my web.xml, I've change the code to use Servlet 3.0's annotations to ease this post, ok?

This is a bit modified example of Compression filter available at Head First Servlet & JSP.

My servlet code:



This is the code of the filter:


Compression response wrapper:



and gzip servlet output stream wrapper:



Thanks in advance.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you uncomment the following line (se debugging tip page 723)
You will see that the browser gets zipped data.

Regards,
Frits
 
reply
    Bookmark Topic Watch Topic
  • New Topic