Hi,

I need to debug servlets with an IDE.  I looked at various resources and books and was 
going to use the HttpServer class to start my developmental servlet.  However, there is
a sun.servlet.http.HttpServer (the one most mentioned in books/FAQs/archives) and the 
com.sun.web.server.HttpServer that comes with JSDK-2.1 and yet another that comes with 
the JSWDK-1.0.1.  I think the latter two are the same except the 
com.sun.web.shell.Startup for JSDK-2.1 somehow uses "default.cfg" while the 
JSWDK-1.0.1 uses "webserver.xml" to configure the server.  Very confusing.....

The question is where are the docs for the com.sun.web.* classes?  If not accessible, 
what parameters can I pass to com.sun.web.shell.Startup, particularly to set my 
docbase and the various webapps/contexts? Or, how can I configure 
com.sun.web.server.HttpServer?

I have tried the following (based on SimpleServer.java in jsdk-2.1/etc):

        HttpServer server = new HttpServer(port, inet, hostname);
        try {
            URL url = resolveURL(servletsDir);
            server.setDocumentBase(url);
            server.setTempDir(new File(tempDir)); // Had to add this to prevent 
exception
            System.out.println("Starting with docbase of: " + url);
            server.start();
        } catch (MalformedURLException mue) {
            System.out.println("Malformed URL Exception for doc root");
            System.out.println(mue.getMessage());
        } catch (HttpServerException hse) {
            System.out.println("Server threw an exception while running");
            System.out.println(hse.getMessage());
        }

But this way the server will serve-up http://localhost:8080/snoop but not 
http://localhost:8080/servlets/snoop or http://localhost:8080/index.html.

Thanks,
Shash
begin:vcard
n:Chatterjee;Sasvata
tel;fax:(972) 996-7119
tel;work:(972) 996-6466
x-mozilla-html:TRUE
url:http://www.ans.alcatel.com
org:Alcatel USA;Optical Networks R&D
version:2.1
email;internet:[EMAIL PROTECTED]
title:Optical Transport Platforms
adr;quoted-printable:;;1225 N. Alma Rd.=0D=0AMS 406-170;Richardson;Texas;75081-2206;USA
x-mozilla-cpt:;18240
fn:Sasvata (Shash) Chatterjee
end:vcard

Reply via email to