Hi there,
I was wondering if there is a way to create an xml page on the fly with jsp by reading in an xml file on the server (this file is not located in the htdocs folder so a regular a href=file.xml wont work ...)
Currently, I have
This will only work via browser my xml files were in /htdocs/myfolder.
Is there a way to print xml files that are not in this folder in similar methods?
I was wondering if there is a way to create an xml page on the fly with jsp by reading in an xml file on the server (this file is not located in the htdocs folder so a regular a href=file.xml wont work ...)
Currently, I have
Code:
String directory = "/home/apache/htdocs/myfolder";
File file = new File(directory);
File[] content = file.listFiles();
Arrays.sort(content);
for (int i=0; i<content.length; i++) {
out.println("<br><a href='myfolder" + content[i].getName() + "'>" + content[i].getName() + "</a>");
}
This will only work via browser my xml files were in /htdocs/myfolder.
Is there a way to print xml files that are not in this folder in similar methods?