Where/how do you try and get the parameter
JSP String someparam = (String)application.getInitParameter("someparam");
Servlet in the init
String someparam =
(String)application.getInitParameter("someparam");
Sometimes this does not work if you try and use the getInitParameter in the
service/post methods.
try getting the configuration and the servletcontext from that.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Petr Podsednik
Sent: 06 April 2001 08:55
To: Orion-Interest
Subject: Re: Where to put application parameters?
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
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Control Centre. For further information visit
http://www.messagelabs.com/stats.asp