Try this:

  String path = "your-relative-path.xml"
  InputStream  ins= null;
  try {
   ins = getClass().getClassLoader().getResourceAsStream(path);
  }
  catch (Throwable ex) {
   com.amaio.util.sys.prn("Error getting XML resource"+ex);
  }

----- Original Message -----
From: Toth [@FREEMAIL], Adam (E-mail) <[EMAIL PROTECTED]>
To: Orion-Interest <[EMAIL PROTECTED]>
Sent: Thursday, April 05, 2001 5:12 PM
Subject: Where to put application parameters?


> Hi,
>
> We're using a component in our sw, and that needs a config XML file.
> The following method is used currently:
>
> java -Dsomeparam=path-to.xml -jar orion.jar
>
> We don't have to source, and it's working ok
>
> I''ve tried to put this into web-inf/web.xml (into EAR in WAR of course)
> like this:
> [..]
> <web-app>
>
>   <context-param>
>     <param-name>someparam</param-name>
>     <param-value>path-to.xml</param-value>
>   </context-param>
> [..]
>
> But it's not working. We're using absolute pathnames on WinNT
> (like C:\dir\dir2\this.xml). so it's not a problem of "where is this
> relative filename starts"
>
> Does anybody know how to solve this? It's not very elegant to deploy an
app
> an use -D options, I think, is it.
>
> It would be nice to take a look at a working solution or hear some
comments
> on this.
>
> Thank you in advance,
> Adam
>


Reply via email to