# re: StrutsTestCase 不需要 写 classpath 方法   ^_^  回复  更多评论
						  
					
					2007-11-08 10:16 by 
				
 
				假设我是用MyEclipse开发的,
setConfigFile("E:/src/StrutsTestCase/WebRoot/WEB-INF/web.xml");
里面的路径是开发时项目中的路径还是发布之后在Tomcat中的路径????
			 
		
			
				
					
						# re: StrutsTestCase 不需要 写 classpath 方法   ^_^  回复  更多评论
						  
					
					2007-11-09 17:16 by 
				
 
				@李泳
不是怎么理解的你的io操作!不要写物理路径。
我告诉你一种方法
这通过Classload来加载 写逻辑路径 就没有这什么考虑的了
可以参考我blog里的介绍
http://www.blogjava.net/Good-Game/archive/2007/08/09/128154.html中的 hbn 加载文件
 
		
			
				
					
						# re: StrutsTestCase 不需要 写 classpath 方法   ^_^  回复  更多评论
						  
					
					2007-11-09 17:20 by 
				
 
				你可以用 
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
new File(
classLoader.get URL 什么方法名字不太记的了 
);
写逻辑名就可以如你的:
/WebRoot/WEB-INF/web.xml