Forums Register Login

HeadFirst JSP - Sample Response Filter code

+Pie Number of slices to send: Send
Hi Friends,

Has any one tried to deploy the compression filter sample program given in HeadFirst JSP/Servlet book.

I tired to deploy the program and found the following issues, I tried in tomcat6 with Netbeans IDE 6.

1.) The First page is a html page called Index.html once deployed the html has a link to a JSP page

I tried refreshing the html page and sometimes I am getting Null pointer exception

2.) The Browser is not displaying the content from JSP page.

I tried downloading and using the same code as provided in the website but iam getting the same results.

Can any body help
+Pie Number of slices to send: Send
can you paste the code here?

and paste the exception you getting.
+Pie Number of slices to send: Send
Hi

This the error I get when I try to deploy the sample code.

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException
com.example.CompressionResponseWrapper.getGZIPOutputStream(CompressionResponseWrapper.java:100)
com.example.CompressionFilter.doFilter(CompressionFilter.java:65)

ie When I do a refresh on the index.html page


Else I get the following response

Test the compression filter. To verify that the content is being compressed, modify the CompressionFilter class by commenting out line 53 (which sets the response header Content-Encoding) and redeploy the webapp. When you view this page again it will look garbled (the browser will be displaying the binary data as characters).

Test the compression of a JSP

Which I click the link TEST I dont get any Output the JSP shows
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1693 times.
Similar Threads
Compression Filter (Head First Servlets)
ServletFilter not being called
JSP in combination with ServletFilter not working
Getting started with J2EE
Resource not Found error continues even after resource is removed from xml file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:53:12.