you can try using an URL for your configuration file storing the xml
file in your webapp/yourapp directory.
InputSource sn = new InputSource("http://server/yourapp/AccessInfo.xml");
You can also limit the access to the file using standard protection methods.
Another way to access you file is by putting it in the WEB-INF directory
of your app and fetching an InputStream with
the getResourceAsStream method of the ServletContext
InputSource sn = new
InputSource(oCtx.getResourceAsStream("Accessinfo.xml"));
(oCtx is your ServletContext object)
Cheers,
Vincenzo
Vijay Shinde wrote:
>Hi All,
>
> I am using XML configuration file for setting application properties.
> I am using class InputSource to load the .xml file.The problem i am
>facing is i need to give absolute path
> for my xml file e.g.
>
> InputSource sn = new InputSource("C:\\Program Files\\Apache Tomcat
>4.0\\webapps\\vstruts\\AccessInfo.xml");
>
>Apache has this directory in the path C:\Program Files\Apache Tomcat
>4.0\common\classes
>
>if i move my file at this path also it doesn't work .I don't know but it
>is not picking file from relative path .
>
>If some one help me out that will be great.
>
>Vijay
>
>
>
>--
>To unsubscribe: <mailto:[EMAIL PROTECTED]>
>For additional commands: <mailto:[EMAIL PROTECTED]>
>Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
>
>
>
--
I have a friend whose a billionaire. He invented Cliff's notes. When
I asked him how he got such a great idea he said, "Well first I...
I just... to make a long story short..."
-- Steven Wright
-----------------------------------------------------
Vincenzo Marchese
ARSRETIA S.r.l.
Via D. Sansotta, 97
00144 Roma (IT)
e-mail: [EMAIL PROTECTED]
Tel.: +39 06 52270097
Fax: +39 06 52272313
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>