This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Response-SetContentType Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Response-SetContentType" Watch "Response-SetContentType" New topic


Akhil Maharaj
Ranch Hand

Joined: Sep 29, 2007
Posts: 63
All ,
I am trying to run the Servlet code to down load the JAR , programme given in HFSJ-Chapter 4 , page 129 .

Where do I have to put the /bookCode.jar ? I keep getting the error that bookCode.jar is not found.

I am using Tomcat 6.0.14 .

Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
Jar files are normally stored in de WEB-INF/lib directory in the webapplication.

Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Akhil Maharaj
Ranch Hand

Joined: Sep 29, 2007
Posts: 63
I just realized that the file needs to be in the root of the web-application as it is given as /bookCode.jar .

Now the code is working . However the size of the file , that I am downloading is 10.2MB where as size of the original source file is 86KB .
I don't understand why it is more after downloading ?

I agree. Here's the link:
subject: Response-SetContentType
Similar Threads
Servlet Context theoretical doubt : HF book
some HFS doubts till chapter 7
Problem with Jar download code in servlet
Servlet code to download the JAR doubt
does the write() method of the OutputStream comit the respose before this call to forward()?