Dynamic Photo Album using JSP

Hi all,

I've been having a bit of trouble getting help with my question - I've tried a couple of usenet groups, however don't seem to be asking the right question. So, I'm hoping that some Java forums may be of more relevance. I'm sorry if this is the wrong place, and if there is a better place for me to ask my question if you could tell me where that is, I'ld be greatful.

I am looking at finding/ making an online dynamic photo album which

uses JSP. I've seen a lot of examples using PHP and a few online

albums using Javascript, however those albums using JavaScript are not

dynamic - the images are hard coded.

My scenario is this, we have about 6 different events with about 150

photos each. What I would like to happen is to be able to have a index

page which lists 10 photos each, and when you click on the photo to be

taken to a secondary page with a larger image. I would like to do this

without needing to create 150 dependant pages.

I understand that we will be looking at using server side technology.

As our pages already use JSP we don't want to add a second server side

language (PHP, Pearl etc...) to the equation.

So does anyone know of a script that may already do this? As I seem to be having no luck in finding one to suit my purpose, I would be happy to create my own script.

The problem is that I am not too familiar with JSP - though I used to do a fair bit of ASP using VB Script. What I would like is to be pointed into a page that will show me how to create an array with a list of filenames in a given directory (using a Site relative path). From there I should be right, but I can't seem to find any references to how this can be done using JSP (or even Javascript).

If anyone can help me I would greatly appreciate it.

Regards

Linda

[1888 byte] By [madhatter.no1a] at [2007-10-2 10:43:13]
# 1

You need to File class, it can produce a list of files in a directory.

File photodir = new File("c:/path/to/photos");

File[] photos = photodir.listFiles();

for(int i = 0; i < photos.length; i++){

File fp = photos[i];

if(fp.isFile()){

// check to see if it is an image

}

}

gimbal2a at 2007-7-13 2:52:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...