How can I access or create a file or folder in the current directory from inside a servlet?

Alex Chaffee

Since there's no telling which directory the servlet engine was launched from, you should always use absolute pathnames from inside a servlet. Usually I pass in the root directory in an InitParameter, and create File objects relative to that directory.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact