As far as i know, its not possible to show a "file browser" on a JSP or HTML page but judging from the people here:
http://www.experts-exchan.../J2EE/JSP/Q_20309435.htmlit should work with the code below:
GeSHi (java):
----------------------------------------
<table name="slave2" width="800" cellpadding="0" cellspacing="0">
<tr>
<th>Filename</th>
<th>code</th>
<th>Filename</th>
<th>code</th>
<th>Filename</th>
<th>code</th>
</tr>
<%
//String expertsLocation = application.getRealPath("/experts") ; //onlyused in a webapp
String expertsLocation =
"F:\\examples\\sample" ;
String[] arEDirs =
new File( expertsLocation
).
list();
for( int ii=0 ; ii< arEDirs.length ; ii++){
File file =
new File(expertsLocation +
"\\" +arEDirs
[ii
]) ;
String type = file.
isFile() ?
" <file>" :
" <dir>";
//file or directory if (ii % 3 == 0){
out.println("<tr><td>") ;
}else if(ii % 3 == 1){
out.println("<td>") ;
}else{
out.println("<td>") ;
}
out.println( "<a style=\"color:#FF0000\" href=\"expertsLocation/" + arEDirs[ii]+"\" >"+ arEDirs[ii].split("\\.")[0] +"</a> " + ""+ "</td>" ) ;
out.println( "<td><a style=\"color:#FF0000\" href=\"experts/code.jsp?file=" + arEDirs[ii] + "\">here</a>") ;
if (ii % 3 == 0){
out.println("</td>") ;
}else if(ii % 3 == 1){
out.println("</td>") ;
}else{
out.println("</td></tr>") ;
}
}
%>
</table>
Created by GeSHI 1.0.7.20