You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Dustin Callaway <DC...@hfnweb.com> on 2000/01/18 17:51:32 UTC

Starting HttpServer from Java app...

Has anyone figured out how to start the Tomcat HttpServer from within a Java
application? Both the Tomcat binaries and source code include a sample file
called SimpleStartup.java that supposedly demonstrates how to do this.
However, this program does not compile due to some API problems. The errant
code looks like this:

int port = 8080;
InetAddress inet = null; // null uses all inets on the machine
String hostname = null;
HttpServer server = new HttpServer(port, inet, hostname);
try {
    URL url = resolveURL("webpages");
    server.setDocumentBase(url);  <<<<<<<<<<<<<<<<<<<< this method does not
exist
    System.out.println("Starting with docbase of: " + url);
    server.start();
}

Unfortunately, HttpServer does not implement the setDocumentBase() method.
Any help is appreciated...

Dustin Callaway