Hi,
Thank You for your help. I copied db.cfg to <app-root>/WEB-INF/classes/.
My browser says "You don't have permission to access /WEB-INF/classes/
on this server", when I use URL http://<virtual_host_name>/WEB-INF/classes/.
But I am able to access it from my browser by using
http://<virtual_host_name>/WEB-INF/classes/db.cfg. The browser displaying
all
the contents of the file. Any guess?.

--thanx
Venkat

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 21, 2001 8:10 PM
Subject: RE: protecting a non-jsp file from accessing


> I would include the file in the same place as the class file (in the
> app-root/web-inf/classes/...)- then you can use something like
> <yourclassname>.class.getResourceAsStream("<sub folder relative to class's
> package>/db.cfg"); Then you can read the configuration properties from
that
> stream (Dont forget to close it after reading the contents).
> By default tomcat blocks all access to the web-inf folder
>
> S.
>
> -----Original Message-----
> From: Venkat Dosapati [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 21, 2001 12:47 AM
> To: Tomcat Users List
> Subject: protecting a non-jsp file from accessing
>
>
> Hi,
> I have been using Tomcat 3.2.1 with Apache for my application deployment.
> In my application I have a database configuration file called db.cfg.
> The file is placed in document root directory. Now my problem is that the
> file can be accessed through the browser by using
> http://<VirtualHostName>/db.cfg.
> Is there anyway to block the file from users. Any ideas will be
appreciated.
>
>
> Thanx in advance.
>
> ----
> Venkat
>
>
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to