I'm trying to read some properties from a file which I have in a URL and when I do it, I have these properties to null and I don't know why. This is my code:
Properties propiedades = new Properties();
URL url2= new URL("http://localhost:3624/web/applets/paqProperties/configuration.xml");
InputStream in =url2.openStream();
Reader reader = new InputStreamReader(in);
propiedades.load(reader);
//propiedades.loadFromXML(new FileInputStream("paqProperties/configuration.xml"));
//propiedades.load(new FileInputStream("paqProperties/configuracion.properties"));
soapAction=propiedades.getProperty("soapAction");
servidor=propiedades.getProperty("servidor");
url=propiedades.getProperty("urlWS");
Why happen this? I just have the last line and this is the output of the xml:
<properties>
<entry key="soapAction">http://localhost:3624/</entry>
<entry key="servidor">http://localhost:3624/web/soa/</entry>
<entry key="urlWS">http://localhost:3624/web/soa/soa.asmx</entry>
<entry key="servidor2">http://localhost:3624/web/soa/</entry>
<entry key="soapAction2">http://localhost:3624/web/soa/getURL</entry>
</properties>
No comments:
Post a Comment