关于tomcat5使用javaben的问题
我在javabean里面读取一个文件,文件是一个配置文件。
File file = new File("shltDb.properties");
String s = file.getAbsolutePath().replace('\\', '/');
properties = new Properties();
FileInputStream fileinputstream = new FileInputStream(s);
properties.load(fileinputstream);
if(fileinputstream != null)
fileinputstream.close();
}catch(IOException ioexception){
System.out.println("read file failure!");
}
问题是其中的配置文件shltDb.properties放在什么地方才能读取到?
#当然指定文件的绝对地址,例如C:\tomcat5\shltDb.properties,这样可以找到文件,但我不想用绝对地址的方式。
我放在tomcat的根目录下,common/classes下都不行,请教会的人。如果解决,88分全奉上。