PDA

View Full Version : How to display server generated images?


mrlight
Dec 10th, 2007, 04:34 AM
Hi,

I have a question about the best design to display a server side generated picture on a jsp Website.

At this time i want to display a jfreechart as jpg. The website has a lot of content and somewhere should by the chart.

I have solved this problem by setting up a special controller for my picture. So when the Browser requests the pic. My server generates it. The problem is, that I can't integrate a click map without doing everything twice.

So my question is is there a way to integrate an image into the request or in the ModelandView?

It would by great if someone could give my a short howto or even a hint...

Thanx!

Sebastian

gehel
Dec 10th, 2007, 05:29 AM
The way HTML works, it has to do a request for the HTML and a second request for the images (at least, I've never seen a way to embed the image data directly into the HTML).

If your problem is code redundancy, you should be able to factorize the code. If the problem is that the computation has to run twice, I dont think there is a solution, except using a cache.

I'd be happy to be proven wrong !

Good luck !