-
1. Re: How do dynamically load the images in JBoss AS 7
peterj Apr 16, 2012 10:50 AM (in response to sudeep.batra)I would do this by defining a system property which you can use to define the directory containing the images. I would write a servlet that uses the directory location and image file name, opens the image file and writes it to the repsonse output. The servlet will also have to change the response mime type to correspond to the image type.
Search the net for "return image from servlet", there are lots of examples.
-
2. Re: How do dynamically load the images in JBoss AS 7
sudeep.batra Apr 16, 2012 11:07 AM (in response to peterj)Hi Pete thanks for your quick reply, but won't this be very slow and bad design since my jsp will be calling this servlet several times on the same page...Any other suggestions ? Would creating a different http server or ftp server to server the images help or be faster ?
-
3. Re: How do dynamically load the images in JBoss AS 7
peterj Apr 16, 2012 11:15 AM (in response to sudeep.batra)This is basically the same algorithm that a web server uses to serve images that are within the web app. Your JSP should be writing <img> tags into the HTML output and let the browser request the separate images, usally in parallel. Thus multiple instances of the servlet will be running, each processing a different image request.