wood burning stoves 2.0*
The moose likes Servlets and the fly likes [HFSJ 2nd Edition] chapter 5 Errata 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 "[HFSJ 2nd Edition] chapter 5 Errata" Watch "[HFSJ 2nd Edition] chapter 5 Errata" New topic

[HFSJ 2nd Edition] chapter 5 Errata

Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
Page # 207

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.
I agree. Here's the link: http://aspose.com/file-tools
subject: [HFSJ 2nd Edition] chapter 5 Errata
Similar Threads
Confused on IllegalStateException
code for file download
Doubt in HTTPServletResponse
IllegalStateException not thrown!
Servlet -Download Jar file