| Author |
setContentType
|
Ranjani Theyagarajan
Greenhorn
Joined: Feb 08, 2006
Posts: 19
|
|
response.setContentType("image/gif"); // insert code here... out.close() which statement will intialize the out variable? a) PrintWriter out=response.getWriter(); b) PrintWriter out=response.GetOutputStream(); c) OutputStream out=response.getOutputStream(); d) ServletOutputStream out=response.getServletOutput(); My answer is C. but the given answer is a. I read somewhere that for binary data need to use getOutPutStream. Please correct me if am wrong Thanks, Ranjani
|
 |
Patrick Williams
Ranch Hand
Joined: Apr 03, 2005
Posts: 213
|
|
|
What is the source of this question (mock exam?)? I agree that C should be the answer given that you are setting the content type to be an image.
|
Patrick<br /> <br />SCJP/SCWCD/SCBCD/SCDJWS/SCEA<br /> <br />Currently working on:<br />SCJP 6
|
 |
Ranjani Theyagarajan
Greenhorn
Joined: Feb 08, 2006
Posts: 19
|
|
|
Thanks Patrick... I got a PDF from my friend which contains this one..
|
 |
 |
|
|
subject: setContentType
|
|
|