• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

gif encoding

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want to generate a number of rectangular boxes with text in each box just like flowcharts.I havent tried anuthing on this but just have the concept in mind.I want to generate it on the fly using jsp pages.For this i need to draw the image on to a virtual awt.Panel object.I am using the GifEncoder API provided by acme which encodes the drawn objects to a gif image and sends to the client.this concept is mentioned by Jason Hunter in his book "Java Servlet programming".
My problem here is that since i want to use the same API from jsp pages and the Api needs to call a method and send the output stream object to it to print the image to the client.now jsp has a out object which is a PrintWriter object.so how can i pass the ServletOutputStream object to it.
The method is :
ServletOutputStream out = res.getOutputStream();
GifEncoder encoder = new GifEncoder(image,out);
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No - don't try to generate binary data from a JSP page. JSP pages just naturally want to output character encoded data. Write a servlet just like in Hunter's book.
Bill
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic