2008年9月17日

     摘要: import java.io.*;

public class Demo {
public static void main(String[] args) {
File dirFile;
File tempFile;
boolean bFile;
String sFileName;

bFile = false;

try {
dirFile = new File("E:\\test");
bFile = dirFile.exists();

if (bFile == true) {
System.out.println("The folder exists.");
} else {
System.out
.println("The folder do not exist,now trying to create a one...");
bFi  阅读全文
posted @ 2008-09-18 10:11 anoic 阅读(1506) | 评论 (1)编辑 收藏

如此这般就可以取得项目发布的绝对路径。x就为路径

        ActionContext ac = ActionContext.getContext();
        ServletContext sc 
= (ServletContext) ac.get(ServletActionContext.SERVLET_CONTEXT);
        String x 
= sc.getRealPath("/");
posted @ 2008-09-17 17:02 anoic 阅读(3477) | 评论 (1)编辑 收藏

导航

<2008年9月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

统计

常用链接

留言簿(3)

随笔档案

文章档案

搜索

最新评论

阅读排行榜

评论排行榜