Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 23639 invoked from network); 18 Jun 2002 20:10:11 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 18 Jun 2002 20:10:11 -0000 Received: (qmail 17549 invoked by uid 97); 18 Jun 2002 20:10:00 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 17418 invoked by uid 97); 18 Jun 2002 20:09:59 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 17293 invoked by uid 98); 18 Jun 2002 20:09:59 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Please help with Tomcat - newbie Date: Tue, 18 Jun 2002 16:03:27 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Please help with Tomcat - newbie Thread-Index: AcIW+hbhgNXk1vqHRLyXiGofKvkIxgACLa/Q From: "Shapira, Yoav" To: "Tomcat Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Howdy ;) By definition (see servlet spec), you can't read anything under WEB-INF. If you could, the right approach would be like =20 String path =3D getServletContext().getRealPath("/WEB-INF/classes") File directory =3D new File(path); ... Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: Simon Wong [mailto:summerrain@btinternet.com] >Sent: Tuesday, June 18, 2002 2:58 PM >To: tomcat-user@jakarta.apache.org >Subject: RE: Please help with Tomcat - newbie > >Hello, > >I am trying to get the servlet to obtain a list of filenames and >directories in my servlet class to be sent back to the applet. However, I >am not sure if my approach is correct. >I used the following code in my servlet class in the directory: C:\(where i >installed my tomcat)\Apache Tomcat 4.0\webapps\ROOT\WEB- >INF\classes\MyServlet.class >Codes in the class: >File directory =3D new File("classes"); >File [] filenames =3D directory.listFile(); >>> The result i get is null. No directory name "classes". >However, when I tried using "." (I presume it means current directory), it >seems to be in windows/system32 ?? >I am quite confused about this. How do I actually refer to the directory I >mentioned above? Do I need to configure anything? I really need help! Your >advise will be much appreciated. Thanks > >Best Regards, >Simon -- To unsubscribe, e-mail: For additional commands, e-mail: