I don't know anything about the Netscape Webserver, but given that the
error message you're getting says "servlet test not found" (i.e. it's
grabbing the directory name and apparently not even getting to the
actual servlet name), perhaps the server doesn't support subdirectories
for servlets?
A couple of things you could still check: You say you did the "javac
HelloWorld.java" from the /servlets/test/ directory. Isn't it the case
that javac automatically creates the subdirectory for packages? So that
you'll end up with /servlets/test/test/HelloWorld.class?
Also, try using a registered name rather than accessing the
subdirectoried servlet directly. That is, in servlets.properties (or
whatever the Netscape equivalent is), put a line like this:
hello.code=test/HelloWorld
and then access the servlet by http://webserver/servlet/hello. If it
still doesn't work, then you're back to maybe the webserver just doesn't
support subdirs. I couldn't get subdirs to work in the servletrunner of
jsdk2.0, but did get it to work in jsdk2.1, so maybe Netscape's
webserver is similarly behind.
--Jim Preston
InterSurvey Inc.
-----Original Message-----
From: Lily Y. Fu [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 29, 1999 12:49 PM
To: [EMAIL PROTECTED]
Subject: Re: subdir under servlets directory
Thanks for all the replies, it makes sense to me that
making it a "test" package, if classes are put under
/servlets/test/ subdirectory, I tried, but it still doesn't
work for me, here is what I did:
1. in /servlets/test/HelloWorld.java
having the following code:
package test;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/html");
ServletOutputStream out = res.getOutputStream();
out.println("<HTML>");
out.println("<HEAD><TITLE>Hello World</TITLE></HEAD>");
out.println("<BODY>");
out.println("<BIG>Hello World</BIG>");
out.println("</BODY></HTML>");
}
2. in /servlets/test/ directory, compiled it:
javac HelloWorld.java
3. access it from a brower:
http://webserver/servlet/test/HelloWorld
4. got error:
created a
[29/Apr/1999:15:44:08] config: for host 10.0.0.1 trying to GET
/servlet/test/HelloWorld, sun/servlet/netscape/NSRunner reports: servlet
test not found
I even restarted the webserver and browser...
Thanks!
Lily
>
>
> I am new to the servlet world, I have a baisc question:
>
> I configured my Netscape Enterprise Webserver as such that
> all servlets (java class files) are put under
> the /servlets/ directory, so if I have a
>
> /servlets/HelloWorld.class
> I can access it from a brower at
http://webserver.../servlet/HelloWorld
>
> However, I'd like to organize the servlet inthe servlets directory,
> to make subdirectories, so I had
>
> /servlets/test/HelloWorld.class
>
> when I tried to access it from
> http://webserver.../servlet/test/HelloWorld
>
> it gave me server error: servlet test not found.
>
> Is there a way to solve this problem?
>
> Thanks,
>
> Lily
>
________________________________________________________________________
___
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html