<HTML>
<HEAD><TITLE>File list</TITLE></HEAD>
<%@ page import="java.io.*"%>
<%String dirstr = "c:\\jakarta\\jakarta-tomcat\\webapps\\examples\\images3";
  String extrapath = "/images3/";
  System.out.println("dir ="+dirstr);
  String fileList[] = null;
  try {
      File dir = new File(dirstr);
      fileList = dir.list();
  } catch (Exception e){System.out.println(e);}
%>

<FORM ACTION= "/examples/servlet/ImageManipServlet" method=Post>

<BODY>
<TABLE border=1 align= center>
<TR><TH>ID</TH><TH>Image</TH></TR>
<%
for(int i=0;i<fileList.length;i++) {%>
<tr><td>
<%=i %>
</td>
<td>
<INPUT TYPE="RADIO" name="images" value= <%= extrapath+fileList[i]%> ><%=fileList[i]%>
</td></tr>
<% }%>
</TABLE>
<INPUT TYPE= "SUBMIT" VALUE="DISPLAY">
<FORM>
</BODY></HTML>