This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes Got funny character from compacting servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Got funny character from compacting servlet" Watch "Got funny character from compacting servlet" New topic
Author

Got funny character from compacting servlet

Hengki Widjaja
Ranch Hand

Joined: Oct 31, 2011
Posts: 44
I've tried this:







And the browser displayed some weird characters instead of a page. Help? THanks
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Any particular reason you're writing your own filter instead of using a ready-made one like http://onjava.com/onjava/2003/11/19/filters.html ?
Hengki Widjaja
Ranch Hand

Joined: Oct 31, 2011
Posts: 44
I think the example is not complete, the GZIPResponseWrapper class is not there.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
The link to the source code is at the bottom of the page.
Hengki Widjaja
Ranch Hand

Joined: Oct 31, 2011
Posts: 44
Thanks, I didn't see that before.
Hengki Widjaja
Ranch Hand

Joined: Oct 31, 2011
Posts: 44
Just when everything seems to work, I got several errors pop up.
java.io.IOException: Cannot flush a closed output stream

Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

Can you post the stack trace and the java file on which the exception occurs ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Got funny character from compacting servlet
 
Similar Threads
How do I avoid IllegalState when calling getReader in chain?
Response filter - doFilter() never returns
Getting contents form the Response Object
JSP with large data loads slow in Solaris10 OS , we are using Jrun4 and nested logic:iterate
Response Wrappers and JSPs