Althoug this won't help much, but don't forget to flush and close your
output stream.
Cheers,
Tammam Al-Hamwy
"Lily Y. Fu" <[EMAIL PROTECTED]> on 04/29/99 03:49:05 PM
Please respond to "A mailing list for discussion about Sun Microsystem's
Java Servlet API Technology."
<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Tom Al-Hamwy/Toronto/IBM)
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