• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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: 3398
312
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: 3398
312
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
 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic