This week's book giveaway is in the Java in General forum. We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line! See this thread for details.
There are two problems with above code. 1) The request is forwarded after committing the response. This will result into IlligalStateException. In the book it is mentioned. 2) The other is with the line marked Erroneous. Here getResourceAsStream() method accepts string parameter. But the URL path should start with '/' i.e. it will search in and from root.