Do you mean the project root Name?if so:
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
//out.print(basePath); //test
And this is automatic by MyEclipse
直接给你发代码呢!!O(∩_∩)O~
package dao;
import java.io.File;
public class uu {
public static void main(String[] args){
File[] roots = File.listRoots();
for (int i=0; i
}
}
}
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
这两个有一个 那个我网了自己 试一下吧
request.getRealPath("/");