aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Where I will use reponse.setHeader and response.setIntHeader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Where I will use reponse.setHeader and response.setIntHeader" Watch "Where I will use reponse.setHeader and response.setIntHeader" New topic
Author

Where I will use reponse.setHeader and response.setIntHeader

Layla Rashid
Ranch Hand

Joined: Dec 25, 2006
Posts: 36
Hi

If I want to set content-lent is 128 then which method I will use.

response.setHeader("Content-length","128") or response.setIntHeader("Content-lenght",128)

Thanks
Layla
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
either of those would work here, since the setIntHeader() method is just a convenience wrapper, internally it would do a String.valueOf(int) to render the int value as a String into the HTTP header.

Though, technically, at the spot where you are setting these content length headers, you could just call


This will set the HTTP header Content-Type for you in the same manner as these setHeader methods.


Error: Keyboard not attached. Press F1 to continue.
Layla Rashid
Ranch Hand

Joined: Dec 25, 2006
Posts: 36
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where I will use reponse.setHeader and response.setIntHeader