How to Use Your Servlets with TiniHttpServer

Return to Index

These instructions assume you have obtained and correctly installed all of the required hardware and software. If you run into problems, please re-read-again all of the documenation and re-double-check-again the installation and configuration of the required hardware and software.

The TiniHttpServer build process now uses ant. This results in a very streamlined build process.


As of verion 0.17, TiniHttpServer uses a new method for mapping request URIs to servlets. This behavior allows for very flexible configuration options, but is substantially different than previous versions. Please pay close attention to step 4 below and be sure to read the Servlet Mappings page.


To Build TiniHttpServer and Deploy to TINI

  1. Make sure that you have all of the required items listed in the Using Your Servlets with TiniHttpServer section of the System Requirements page.

  2. Edit the file build.properties file and ensure that all the paths, files, etc. accurately reflect your installations of the various components. Read the comments in build.properties for full information about the various properties you can configure there.

  3. Open a Command Prompt (shell) window and change to the TiniHttpServer1.0 directory.

  4. Edit the tini/etc/servlets.props file to add mappings for your servlets. This is a critical step. If you do not create mappings for your servlets, they will not be accessible. This is a significant change from previous versions. Please read the Servlet Mappings page for full details.

    After deploying, you can also edit the /etc/servlets.props file on TINI directly using TEd.

  5. If TiniHttpServer is already running on your TINI, it is recommended to kill it before deploying a new copy.

  6. Run ant (with no parameters) to build and deploy TiniHttpServer top your TINI.

    You should see BUILD SUCCESSFUL near the bottom of the output after this build finishes. If so, your TINI will now contain the following files:

    If you encounter problems, run:

    ant -debug -logfile ant.log clean tini

    and then examine ant.log for possible causes of the problems.

  7. Using telnet, login to your TINI. You can use JavaKit to login to your TINI, but then you will not see the output when TiniHttpServer is run in the background.

  8. Type: source /bin/TiniHttpServer

    After a short while, you should see the following:

    SSC Web Server/1.0
    Copyright (C) 1999-2002  Smart Software Consulting
    
    OneWireServlet: init
    

    If your servlet is preloaded (see Servlet Mappings), you will also see your servlet's initialization messages, if any.

  9. Point your web browser at your TINI. For example, if your TINI is named kumquat, you should go to the following URL:

    http://kumquat/

  10. If you want to serve other documents from your TINI, FTP them to the /docs directory (or below it). The file /docs/foo/bar.html can be accessed from a web browser via the following URL:

    http://kumquat/foo/bar.html

  11. To access your servlet go to a URL that matches the servlet's mapping. See Servlet Mappings for details.

  12. To start TiniHttpServer every time your TINI reboots, add the following line to the end of your /etc/.startup file:

    java /bin/TiniHttpServer.tini /etc/server.props &


Copyright © 1999-2002 Smart Software Consulting