dcsimg
how can i locate the resource file in the weblogic?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zhebin_cong
Posted On:   Tuesday, August 20, 2002 11:51 PM

hello in struts, i can leave some parameter in a resource file (such as "Application.properties")outside of my code,and get them in the "Action" class by the "getResource" method. in my data access tier,i still want to use such a machanism but i can't use the "getResource()" method,for example,there is a ConnectionPool class,i want to read some parameters from a resource file ("param.properties") that is under the same directory as the ConnectionPool class,the following is the code snippet: .................... .................... public static void init(DataSource ds){ myself=new ConnectionPool(ds); java.util.Properties prop=new java   More>>

hello


in struts, i can leave some parameter in a resource file (such as "Application.properties")outside of my code,and get them in the "Action" class by the "getResource" method.
in my data access tier,i still want to use such a machanism but i can't use the "getResource()" method,for example,there is a ConnectionPool class,i want to read some parameters from a resource file ("param.properties") that is under the same directory as the ConnectionPool class,the following is the code snippet:


....................
....................

public static void init(DataSource ds){
myself=new ConnectionPool(ds);

java.util.Properties prop=new java.util.Properties();
try{

java.io.FileInputStream fin=new java.io.FileInputStream("./param.properties");
prop.load(fin);

}catch(Exception e){

e.printStackTrace();
}

System.out.println(prop.get("help.create"));
}

.......................
.......................


the "ConnectionPool" class is in the "com.jhtop.task.forum.db.util" package,the "param.properties" is in the same package (com.jhtop.task.forum.db.util),
but when i execute the program,it tell me that it can't find the file.if i use the absolute path,it works.


i wonder how can i locate the file path in the weblogic,or what's my current path,or how may i setup my work directory?


in tomcat,my current directory is bin directory,how about weblogic?


who can help me?thank you!    <<Less
About | Sitemap | Contact