The Artima Developer Community
Sponsored Link

Java Answers Forum
Multipart Response(Sending Image and Some HTml Content)Using Servlets

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Murthy CHVR

Posts: 3
Nickname: chamarthy
Registered: Nov, 2003

Multipart Response(Sending Image and Some HTml Content)Using Servlets Posted: Nov 5, 2003 12:38 AM
Reply to this message Reply
Advertisement
Hi ,
I want to Display Image and at the same time HTML Content.Without Using MultiPartresponse Iam getting Image(Graphical Chart).But using MultiPartResponse In the place of Image iam getting Some Characters.
I would be appreciated if Any one having Idea how to do it
Thanks in Adavance
Chamarthy
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();

Topic: com.sun.java.swing.plaf.windows.* Previous Topic   Next Topic Topic: problem by using vendor

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use