You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Simon Wong <su...@btinternet.com> on 2002/06/18 20:57:47 UTC

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 = new File("classes");
File [] filenames = 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