I'm trying to create a JSP that reads the contents of a directory and creates a list of links to the files in that directory. The idea is that the user should be able to click on one of the links, and open the file up.
The code correctly creates a list of hyperlinked files, but when I click on the links, the files do not open. No dialog comes up, or anything.
1) Why do you complicate your JSP pages needlessly by generating HTML in Java code
Because you're looking at what is literally my first attempt at a JSP after less than a day of study. It naturally follows that it's going to contain things that look funny/inefficient/complicated to someone who knows more than I do.
2) What do you see at the browser via View Source? Is your HTML as you expected?
IE6 correctly interprets the URL's that my code created as files. That is, when you do a copy link, they come out as "file:///BLAHBLAH". I tried doing it explicitly anyway, and the results were the same.
Originally posted by Bear Bibeault: Valid file protocol URLs are of the form:
I copied your output to a plain html file and it operated without problems. One thing you might look into is how the browser is configured to handle various MIME types. It may be having problems dealing with files without file types.
Does the .txt file link work? The browser should know how to handle that file type.
P.S. You do realize that this will only work when the client and the server are the same machine, right? [ October 20, 2004: Message edited by: Bear Bibeault ]