The Stand-Alone Jaxcent Web Server

The Jaxcent download includes a minimal server that can be used for static (HTML, image etc) as well as Jaxcent files.

This server can be specially useful in debugging, because it allows debugging Jaxcent with any Java IDE.

To use this server, the files jaxcentFramework21.jar and jaxcent21.jar need to be in the classpath.

To start the server from the command line, the syntax is:

    java jaxcentServer.ServerMain <port-number> <HTML-root> <XML-Config-file> <Optional-Reloadable-classpath>
For instance,
    java jaxcentServer.ServerMain 80 C:\MyHtmlFiles C:\JaxcentConfig.xml
or
    java jaxcentServer.ServerMain 80 C:\MyHtmlFiles C:\JaxcentConfig.xml C:\MyJaxcentClasses
When debugging, the reloadable classpath should not be used as it could confuse the debugger -- instead the necessary classpath should be provided to the IDE.

Starting the stand-alone Web Server programmatically

The server can also be started programmatically. To do this, instantiate the class jaxcentServer.ServerMain. This class extends java.lang.Thread. After instantiating it, start the thread. E.g.
    ServerMain jaxcentServer = new ServerMain( 80, htmlDir, xmlConfigFile, reloadableClasspath );
    jaxcentServer.start();
The last parameter reloadableClasspath can be null. In debugging, typically you may want to provide null here, and specify the full classpath in the IDE.

Samples

The samples folder contains a file RunSamples containing the command necessary to start the Jaxcent stand-alone web-server on the samples. After running this command successfully, the samples may be viewed at http://localhost/