• Post Reply Bookmark Topic Watch Topic
  • New Topic

HeadFirst JSP - Sample Response Filter code  RSS feed

 
siva kumar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
subodh gupta
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you paste the code here?

and paste the exception you getting.
 
siva kumar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!