applet read server prop

Hello

I cannot figure out how to get an applet, to read a simple properties file that is at the same directory level as the html/jsp file that loads it. I have tried below and it fails with fnf, even though if I put in the full url name in the browser it opens the fil directly. What dont I understand sufficiently to read the file and return a properties object? tia

public Properties getProps(String fname){

Properties props =new Properties();

InputStream propIn =null;

String line;

URL url =null;

try{

url =new URL(getCodeBase(), fname);

}catch (MalformedURLException ex){

System.out.println("MalformedURLException");

ex.printStackTrace();

}

try{

propIn =new FileInputStream(url.toString());

}catch (FileNotFoundException ex1){

System.out.print("FileNotFoundException");

ex1.printStackTrace();

}

try{

props.load(propIn);

}catch (IOException ex2){

System.out.println("IOException on props.load()");

ex2.printStackTrace();

}

return props;

}

[1987 byte] By [aster_bodya] at [2007-11-27 9:11:19]
# 1
Try something likeprops.load((new URL(getCodeBase(), "user.props")).openStream());Bye.-- http://www.rgagnon.com/howto.html
RealHowToa at 2007-7-12 21:56:45 > top of Java-index,Desktop,Core GUI APIs...