hi,
I want to access myMessegeResources.properties.However, if i try to access it 
this way it throws an exception of FileNotFound.However if i give Disk absolute 
path then it accesses that myMessegeResources.properties file.
  How to access the relative file in WEB-INF

1)Doesn't Works:-Here i have tried various relative paths to WEB-INF but not 
worked!

public class showFilevalues {
public static void main(String args[])throws Exception
    {
      FileReader fr=new FileReader  
("/WEB-INF/classes/myMessegeResources.properties");
      BufferedReader br=new BufferedReader(fr);
      String s;
      while((s=br.readLine())!= null){
      System.out.println(s);        }
    fr.close();
      }
}      



This Works:-
public class showFilevalues {
public static void main(String args[])throws Exception
    {
      FileReader fr=new FileReader  
("C:/eclipse/workspace/shail/myProjectcontext/WEB-INF/classes/myMessegeResources.properties");
      BufferedReader br=new BufferedReader(fr);
      String s;
      while((s=br.readLine())!= null){
      System.out.println(s);        }
    fr.close();
      }
}      
  Is it Possible to how to access the relative file?

Regards, 
Shailesh

Reply via email to