Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Can I put private servlet files in the WEB-INF directory?

Reply
Thread Tools

Can I put private servlet files in the WEB-INF directory?

 
 
William Krick
Guest
Posts: n/a
 
      08-25-2004
I am currently experimenting with a servlet that makes use of data
files to store information. I'd prefer that these files be NOT
publicly accessible but
I don't know if it's ok to put my own files into the WEB-INF directory
to "hide" them from users or if I should put them in a
hidden/protected folder OUTSIDE the deployment directory.

Is there a general consensus on this?

....
Krick
 
Reply With Quote
 
 
 
 
John C. Bollinger
Guest
Posts: n/a
 
      08-25-2004
William Krick wrote:

> I am currently experimenting with a servlet that makes use of data
> files to store information. I'd prefer that these files be NOT
> publicly accessible but
> I don't know if it's ok to put my own files into the WEB-INF directory
> to "hide" them from users or if I should put them in a
> hidden/protected folder OUTSIDE the deployment directory.
>
> Is there a general consensus on this?


You can put anything you want into WEB-INF/, as long as it doesn't
conflict with the files that the Servlet container expects to find
there. It sounds like your planned use is perfectly in line with its
purpose. Indeed, I think that having your servlet rely on non-shared
files outside its deployment directory is a much worse idea than using
WEB-INF. Best might be to put the files specifically in
WEB-INF/classes, from which location they can be located by your
servlet's ClassLoader (e.g. w/ getResource() or getResourceAsStream()).


John Bollinger
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
William Krick
Guest
Posts: n/a
 
      08-26-2004
"John C. Bollinger" <(E-Mail Removed)> wrote in message news:<cgigv1$d9g$(E-Mail Removed)>...
> William Krick wrote:
>
> > I am currently experimenting with a servlet that makes use of data
> > files to store information. I'd prefer that these files be NOT
> > publicly accessible but
> > I don't know if it's ok to put my own files into the WEB-INF directory
> > to "hide" them from users or if I should put them in a
> > hidden/protected folder OUTSIDE the deployment directory.
> >
> > Is there a general consensus on this?

>
> You can put anything you want into WEB-INF/, as long as it doesn't
> conflict with the files that the Servlet container expects to find
> there. It sounds like your planned use is perfectly in line with its
> purpose. Indeed, I think that having your servlet rely on non-shared
> files outside its deployment directory is a much worse idea than using
> WEB-INF. Best might be to put the files specifically in
> WEB-INF/classes, from which location they can be located by your
> servlet's ClassLoader (e.g. w/ getResource() or getResourceAsStream()).


Actually, the servlet is an instance of the HSQLDB database and it
handles all the file activity itself. I just need to give it a path.
Thanks again for your input.

....
Krick
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to keep your private files private John Holmes Computer Support 0 02-21-2006 10:34 PM
Re: How to keep your private files private Steve Computer Support 1 02-21-2006 08:24 PM
Re: How to keep your private files private HMV Computer Support 0 02-21-2006 04:54 PM
Tomcat ssl servlet to servlet, private CA edavid3001@gmail.com Java 0 10-06-2005 09:03 PM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM



Advertisments