wood burning stoves 2.0*
The moose likes Meaningless Drivel and the fly likes Oracle Chart (Graphs, Charts) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "Oracle Chart (Graphs, Charts)" Watch "Oracle Chart (Graphs, Charts)" New topic
Author

Oracle Chart (Graphs, Charts)

Suvendu Mishra
Greenhorn

Joined: Jul 31, 2006
Posts: 1
Hi,
I am using oracle chart (supplied by Oracle) in our web application.
The approach is simple:
1. Jsp collects the data and invokes a java class.
2. Java class then using the data builds a chart and creates an image file.
3. Then jsp shows that image file using "img" tag.
I am always giving a same name to the image file.
So when multiple users are accessing the page sometimes JSP is not able to show the image. Because, when one process has a lock on that image file, another process is trying to overwrite the same file. Some OS/application server error gets thrown mentioning that image can't be shown.

Is there any other solution to this problem (other than giving a unique name to the image file for each request)?
======================================================================
am thinking of the following solution but unable to use it.

Instead of creating the image, we will get the byte array from buffered image object, then send it from jsp after setting the content type to image/gif.

So, I have coded this:
response.setContentType("image/gif");
byte [] t =
((DataBufferByte)(myBufferedImage).getRaster().getDataBuffer()).getData();

response.getOutputStream(t).

But when I run the program no image is getting shown.



Regards,
Suvendu K. Mishra
 
wood burning stoves
 
subject: Oracle Chart (Graphs, Charts)