jsp怎样获得文件夹?(类似HTML 的file控件)
用什么方式实现都行。。
Java code:
String aa = request.getRealPath("/UserFtp/"+listproduct.get(i));
File MyDir = new File(aa+".");
String filename[] = MyDir.list();
我的意思是类似file控件 选的 html file 只能选择文件名 我现在需要选择文件夹
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JS实现打开文件夹对话框 </title>
</head>
<script language="javascript">
function chooseFolder(){
var savePath;
var objSrc=new ActiveXObject("Shell.Application").BrowseForFolder(0,'请选择文件目录:',0,'');
if(objSrc!=null){
savePath=objSrc.Items().Path;
document.all.savePath.value=savePath;
}
}
</script>
<body>
<input type="te" size="30" name="savePath"/>
<input type="button" na
相关问答:
我的开发的平台是Myeclipes6.0 + tomcat5.x + mysql
我所有的编码方式都是用的UTF-8
我只用了Strtus框架
在一个form中如下用的是post的提交方式:
<form class="form" action=&quo ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
一个JSP页面接收其他页面提交过来的FORM表单,但是要求只接收当前站点及其子站点提交过来的FORM表单,其他站点提交过来的表单不接收,这个怎么设置?
用过滤器
filter
将当前站点及其子站点放一个目录
然 ......
<html><head><title>[@title]</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<script language='javascript'>
function diyCheck ......