I wonder if anyone has come across this problem in Manning's book. In listing 4.8 on p53, the line URL url = context.getResource("files/test"); doesn't work quite well. In fact, you have to add a "/" before "files/test" to make it work. Another problem is that by this way, it will always download the jar file by the name of the servlet itself. If you want to specify the name of the download file, you have to add another line: res.setHeader("content-disposition", "attachment;filename=test.jar"); after line: res.setContentType("application/octet-stream"); Can anyone tell me the difference between: res.setContentType("application/octet-stream"); and res.setContentType("application/jar"); Thanks a lot.