Results 1 to 6 of 6
Thread: Dynamic image loading in jsp
- 01-04-2008, 02:04 PM #1
Member
- Join Date
- Jan 2008
- Posts
- 1
- Rep Power
- 0
Dynamic image loading in jsp
Hi,
I need to load the dynamic images in jsp, where images are stroing outside the application server not part of deployment, images are placed on some folder in linux server.
I will get the path of the image from the database and i need to fetch the images from the mentioned path and load the images in jsp using custom tags.
Thanks for the solution in advance.
Thanks,
Ramakrishna K M
- 01-04-2008, 08:50 PM #2
As the result what will your JSP serve .. Image Binary data or HTML code for image and someway you will put that remote Image to public accessible place. Please clear on this ..
dont worry newbie, we got you covered.
- 01-05-2008, 07:54 AM #3
Member
- Join Date
- Jan 2008
- Posts
- 5
- Rep Power
- 0
U have mentioned that u could get the physical path of images from database.
Then there's no problem get the path into a string in the jsp page using scriptlet and have and img tag give the src of img tag to the String which v point to the path from the db.
All the best
- 01-05-2008, 08:12 AM #4
You have two options:
1. In some cache/temp directory (which must be accessible to web server) write the image file from database. And serve the url of that page to the client. This might be inefficient though. You cant get image path if the image is stored binary in database instead of just a link to some directory.
2. You might have seen capcha, these are live rendering and surely you can do with JSP as well. Tags doesnot play any role here. What you can do is define one JSP/Servlet that renders the live image.
For example your image is associated with PK xyz then you can pass argument XYZ to that servlet ?image=XYZ in path. That servlet should set content type to MIME type of jpeg or what ever the encoder you are using. Then you can encode directly to the response stream. Do some research on OTN (Oracle) as well they (Their Application Server) use to support these things directly.
Hope it should help you a bit..dont worry newbie, we got you covered.
- 06-11-2008, 09:09 PM #5
Member
- Join Date
- Jun 2008
- Posts
- 1
- Rep Power
- 0
Hi everybody !!!!
Hi,I have just joined in this forum.
Saying just Hi to you all. :)
- 10-10-2011, 06:08 AM #6
Member
- Join Date
- Oct 2011
- Posts
- 1
- Rep Power
- 0
Re: Dynamic image loading in jsp
Hello there,
I tried using the above code to refresh an image in my webpage. It does not work. It loads the image only once and stays put. Am I doing something wrong? Could someone kindly help me?
Thanks.
Some insight:Java Code:<!DOCTYPE html> <%@ page import="java.util.*" %> <%@ page import="java.util.Calendar" %> <%@ page import="java.io.File" %> <%@ page import="java.io.*" %> <%@ page language="java" import="java.util.*"%> <HTML> <head> </head> <BODY> <img src="C:\\WebDev\\uploads\\image\\image.jpg" border="1" name="track"> <script language="JavaScript" type="text/javascript"> function refreshImage(){ image = "C:\\WebDev\\uploads\\image\\image.jpg" document.images["track"].src = image; System.out.println("Cycle\n"); setTimeout("refreshImage()", 5000); } refreshImage(); </script> </BODY> </HTML>
There will be an image, say image.jpg at a fixed location in the server. It will be overwritten by another program over and over again. I want the webpage to keep loading that same image again and again so that the client can see the progress. I have managed to refresh the page automatically, but that is not what I want to do. I just want the image to refresh.
Similar Threads
-
Loading Image from local directory
By nancyhung in forum Advanced JavaReplies: 0Last Post: 01-29-2008, 03:46 PM -
Loading An Image Help Please!
By shaungoater in forum Java 2DReplies: 2Last Post: 01-09-2008, 08:14 AM -
Converting multiple banded image into single banded image... Image enhancement
By archanajathan in forum Advanced JavaReplies: 0Last Post: 01-08-2008, 05:29 PM -
how to generate dynamic pdf
By valery in forum Advanced JavaReplies: 1Last Post: 08-06-2007, 10:01 PM -
problems when loading an image in servlet
By oregon in forum Java ServletReplies: 1Last Post: 08-05-2007, 06:02 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks