Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 16th, 2006, 02:00 AM
Authorized User
 
Join Date: May 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to load an image from servlet

hi i am currently using the JFreeChart API and the existing code is something like this

Code:
Create the chart dataset from one servlet that is submitted to by the form. the control comes back and img tag calls the chart servlet from the "src" attribute.

now this servlet gets a chart object and writes it to the output stream

JFreeChart chart = WNChartFactory.createPieChart ("PT_TEMPLATE2", objDefaultPieDataset);

resp.setContentType ("image/png");
ChartUtilities.writeChartAsPNG (out, chart, 230, 200);
The factory is just to give an object. i would like to simplify this process by calling only one servlet.

secondly i am looking at a possibity like i add something to the buffered output stream and reading it on my jsp in th form of bytes and displaying. i am not sure if this is possible and i am not getting any idea on this

plz help me

thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i load a wmf image jerryham VB.NET 0 October 20th, 2008 12:55 PM
load a image from database pedrocosta24306 BOOK: Access 2003 VBA Programmer's Reference 0 January 5th, 2007 11:35 PM
How to load image Edit control cyberrider VB How-To 1 November 4th, 2005 02:25 PM
Load image from URL JonnyRPI ASP.NET 1.0 and 1.1 Basics 0 June 9th, 2003 06:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.