From: Nathaniel G. A. <nat...@ya...> - 2004-11-04 21:52:31
|
something is getting written to the reponse before you encode the chart. Check your code and if you are not doing it then Struts is. If Struts is, you could always add a Servlet which renders the Chart. I would not write the image to a file, as the performance of that would not be good. --- Chris Ward <cw...@go...> wrote: > On Thursday 04 November 2004 02:25 pm, Victor Nammour wrote: > > Hi, > > Thank you for your outstanding software. > > I am using struts in a web application. As you are familiar, struts uses > > a single action servlet which the developer views as a black box. > > My question: When I encode my chart in an action class, and then forward > > to a jsp to display that chart, I see the chart but when I print the > > stacktrace I get the message: > > java.lang.IllegalStateException: Cannot forward after response has been > > committed > > > > I encode by saying. > > JPEGEncoder13.encode( axisChart, 1.0f, response.getOutputStream()); > > in my action class. > > Is there a way to use another output stream and then display this output > > stream in a jsp page? Or do I have to extend the action servlet? > > > > Thank you . > > > > Victor Nammour > > Software Developer > > Office of Information Technology > > Trenton, NJ > > > It is never a good idea to try to output binary data from a JSP page. They > were not intended for that. If you are trying to output just a chart image, > and no html, maybe you need a different struts view (not sure how that is > done, not a struts person). If you want to display the image of a graph on a > jsp page, you should probably save the image to a file location, and then > display the graph as an image normally would be done in html. > > Chris > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > jCharts-users mailing list > jCh...@li... > https://lists.sourceforge.net/lists/listinfo/jcharts-users > __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com |