Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compression Filter

 
Adolfo Eloy
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • 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.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2445
96
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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
Saloon Keeper
Pie
Posts: 2445
96
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic