| Author |
MultipartResponse(Sending Image and HTml Content )Servlets
|
Venkata Ramana Murty
Greenhorn
Joined: Nov 05, 2003
Posts: 1
|
|
Hi, Iam trying to send Image and Html/Plain Content using MultipartResponse Using Servlets,But the image is not dispplaying ,And Some junk Characters are coming in that place.I would Be thankful if any one can help me out.Code Also appended to the mail Thanks in Advance Murthy Code: ServletOutputStream out=param_Response.getOutputStream(); MultipartResponse multi = new MultipartResponse(param_Response); multi.startResponse("text/plain"); out.println("On your mark"); multi.endResponse(); try { Thread.sleep(1000); } catch (InterruptedException e) { } multi.startResponse("text/plain"); out.println("Get set"); multi.endResponse(); try { Thread.sleep(1000); } catch (InterruptedException e) { } multi.startResponse("image/gif"); Image image = chart.getImage(600,400); GifEncoder gif = new GifEncoder (image,out); gif.encode(); //out.flush(); multi.endResponse(); try { Thread.sleep(1000); } catch (InterruptedException e) { } multi.startResponse("text/plain"); out.println("Plain text After Image Content Set"); multi.endResponse(); try { Thread.sleep(1000); } catch (InterruptedException e) { } multi.finish();
|
 |
Mike Curwen
Ranch Hand
Joined: Feb 20, 2001
Posts: 3695
|
|
|
Does the browser support multi-part responses?
|
 |
 |
|
|
subject: MultipartResponse(Sending Image and HTml Content )Servlets
|
|
|