Generate PieChart 3D+ Struts

Hi,
      I am using JFree chart for generating piechart.I am using the method "ChartFactory.createPiechart3D". This is written in a utility class which returns me the buffered image object. Using a servlet, i call the method in the utility class and get the buffered image output in the servlet.
    Now, my servlet contains the buffered image output.
    All i have to do is transfer this image to a jsp inorder to display the piechart to the user.
 ( I have to include the servlet in my jsp)
   I 'll be very thankful to the person whomever is helping me out in this context.
     
ramsharma23Asked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
Your servlet needs to encode the image as a byte stream (eg. a jpeg stream) and return that in the response stream

ImageIO.write(image, "jpeg", response.getOutputStream());
0
 
TimYatesConnect With a Mentor Commented:
>> All i have to do is transfer this image to a jsp inorder to display the piechart to the user.

Just use an IMG tag:

<IMG SRC="/YourServlet"/>

and the line objects gave you, and you're done :-)

Tim
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.