File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Pushing images to jsp page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Pushing images to jsp page?" Watch "Pushing images to jsp page?" New topic
Author

Pushing images to jsp page?

G Svensson
Greenhorn

Joined: Jul 26, 2009
Posts: 17
I need help with a performance issue, loading many images to a jsp page.

Here is the work flow as of today:

- I have a web page with a search text box.
- The search string is passed to Google Image Search.
- The result web page is parsed for tags and images are downloaded for a more tailor made later presentation.
- One requirement is that the images should be renamed and linked as: http://www.MyDomain.com/images/image0001.jpg regardless of there former name and the final web page contains these links.

All the above works today but I have one performance issue here. If many images are found I will have to wait for all of them to be downloaded to the web server before they start to load to the browser. I want the first image to start load to the browser immediately after is has arrived to the web server.

My guess is that I will have to make some kind of servlet for sending images to a web page capable of receiving images dynamically. HERE is where you nice code ranch java cowboys come into the picture. Do you have any suggestion for the best practice on how to make this work. Feel free to ask anything that appears unclear.

Cheers,

Surrven
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


One requirement is that the images should be renamed and linked as: http://www.MyDomain.com/images/image0001.jpg regardless of there former name and the final web page contains these links.

Can you do this without infringing copyright? I'm no expert but it sounds a little iffy.


My guess is that I will have to make some kind of servlet for sending images to a web page capable of receiving images dynamically

This can't be done. HTTP does not support push. What you could do is use AJAX to poll and update, or use Comet. Both will simulate push.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pushing images to jsp page?