用jsp如何实现下拉列表框列出指定文件夹里的所有文件 随便什么方法的话那就用最简单的<input type="file" name="aaaaaa" > 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><script language="javascript">function doreturn(){ var strReturn=""; strReturn=document.theForm.added.options[document.theForm.added.selectedIndex].value; //alert(strReturn); window.returnValue=strReturn; window.close()}</script><%String strid="file";String path = request.getRealPath(strid);//½¨Á¢´ú±íĿǰĿ¼λÖõÄd±äÁ¿File d = new File(path);//È¡µÃ´ú±íĿ¼ÖÐËùÓÐÎļþFile list[] = d.listFiles();%><body><table align=center border=1><form name="theForm"><tr> <td width="120"> <select size="12" name="added" multiple style="width:100%;" ondblclick="javascript:addit(added,tobeadd)"> <%for(int i=0; i < list.length; i++) { if(list[i].isDirectory()){}else{ %> <option value="<%=list[i].getName()%>"><%=list[i].getName()%></option> <% } } %> </select> </td> </tr> <tr> <td> <input type=button value="È·¶¨" onclick="doreturn();"> </td> </tr> </form> </table> </body> </html> <html><script language="javascript">function doreturn(){ var strReturn=""; strReturn=document.theForm.added.options[document.theForm.added.selectedIndex].value; //alert(strReturn); window.returnValue=strReturn; window.close()}</script><%String strid="file";String path = request.getRealPath(strid);//建立代表目前目录位置的d变量File d = new File(path);//取得代表目录中所有文件File list[] = d.listFiles();%><body><table align=center border=1><form name="theForm"><tr> <td width="120"> <select size="12" name="added" multiple style="width:100%;" ondblclick="javascript:addit(added,tobeadd)"> <%for(int i=0; i < list.length; i++) { if(list[i].isDirectory()){}else{ %> <option value="<%=list[i].getName()%>"><%=list[i].getName()%></option> <% } } %> </select> </td> </tr> <tr> <td> <input type=button value="确定" onclick="doreturn();"> </td> </tr> </form> </table> </body> </html> 在response.sendRedirect(nextPage)如何向nextPage设定新的Parameter 来帮帮我 问个比较弱的问题~ spring2如何和spring security3兼容? 求助第一天用struts遇到的错误 请问hibernate.cfg.xml文件在哪里 jsp有几种错误代码 像500和404这样的。 如何在在一个frame中实现图形导航的功能 中文编码问题紧急求助 (高分)求解关于getString() java的MD5加密方法。 如何实现,EXCEL画表格问题?
<script language="javascript">
function doreturn(){
var strReturn="";
strReturn=document.theForm.added.options[document.theForm.added.selectedIndex].value;
//alert(strReturn);
window.returnValue=strReturn;
window.close()
}
</script>
<%
String strid="file";
String path = request.getRealPath(strid);//½¨Á¢´ú±íĿǰĿ¼λÖõÄd±äÁ¿
File d = new File(path);
//È¡µÃ´ú±íĿ¼ÖÐËùÓÐÎļþ
File list[] = d.listFiles();
%>
<body>
<table align=center border=1>
<form name="theForm">
<tr>
<td width="120">
<select size="12" name="added" multiple style="width:100%;" ondblclick="javascript:addit(added,tobeadd)">
<%for(int i=0; i < list.length; i++)
{
if(list[i].isDirectory()){}else{
%>
<option value="<%=list[i].getName()%>"><%=list[i].getName()%></option>
<%
}
}
%>
</select>
</td>
</tr>
<tr>
<td>
<input type=button value="È·¶¨" onclick="doreturn();">
</td>
</tr>
</form>
</table>
</body>
</html>
<script language="javascript">
function doreturn(){
var strReturn="";
strReturn=document.theForm.added.options[document.theForm.added.selectedIndex].value;
//alert(strReturn);
window.returnValue=strReturn;
window.close()
}
</script>
<%
String strid="file";
String path = request.getRealPath(strid);//建立代表目前目录位置的d变量
File d = new File(path);
//取得代表目录中所有文件
File list[] = d.listFiles();
%>
<body>
<table align=center border=1>
<form name="theForm">
<tr>
<td width="120">
<select size="12" name="added" multiple style="width:100%;" ondblclick="javascript:addit(added,tobeadd)">
<%for(int i=0; i < list.length; i++)
{
if(list[i].isDirectory()){}else{
%>
<option value="<%=list[i].getName()%>"><%=list[i].getName()%></option>
<%
}
}
%>
</select>
</td>
</tr>
<tr>
<td>
<input type=button value="确定" onclick="doreturn();">
</td>
</tr>
</form>
</table>
</body>
</html>