The TiniHttpServer distribution includes nine sample servlets: SnoopServlet, SessionServlet, AuthenticatedServlet, BackupServlet, TiniServlet, OneWireServlet, FamilyCode10Servlet, FamilyCode12Servlet, and FamilyCode20Servlet.
Using the mappings included in the default servlets.props
file, these servlets can be accessed via the following URLs
(assuming your TINI is named kumquat
):
http://kumquat/servlet/SnoopServlet
http://kumquat/snoop
http://kumquat/servlet/SessionServlet
http://kumquat/servlet/AuthorizedServlet
http://kumquat/servlet/BackupServlet
http://kumquat/servlet/TiniServlet
http://kumquat/servlet/OneWireServlet
SnoopServlet shows various headers and parameters from your browser's HTTP request. It also shows any initial arguments specified along with the servlet mappings. SnoopServlet is useful for verifying that TiniHttpServer is actually serving servlets.
Note that the default /etc/servlets.props
file specifies two distinct instances of SnoopServlet.
One instance is accessible via
http://kumquat/servlet/SnoopServlet
. The
other instance is accessible via
http://kumquat/snoop
. Visit both and observe
the different inital arguments of each instance.
SessionServlet uses sessions to track how many times a user has accessed it. Sessions expire after some period of inactivity, which can be specified along with the servlet mappings.
AuthenticatedServlet uses com.smartsc.http.AuthenticatedHttpServlet to authenticate access to it. It shows how to utilize AuthenticatedHttpServlet to create authenticating servlets that use HTTP's authentication/authorization capabilities to restrict access. Use smartsc as both the username and password to access it. The page displayed upon successful authentication is not very interesting, but it shows the potential.
BackupServlet creates a backup and restore scripts that consist of a series of FTP commands. These scripts can be used in conjunction with a command line FTP client to backup and restore all of the files in your TINI's file system. It can take alot of time to get your TINI setup just the way you like it. You should back it up to prevent lost data and time in case you happen to lose your heap!
TiniServlet displays all of the 1-Wire ROM IDs found on TINI's internal and external 1-Wire interfaces. If any of the ROM IDs have a family code of 09h or 89h, TiniServlet will dump the memory contents of these devices. Since TINI uses the 2502-UNW (family code 89h) on its internal 1-Wire bus as the source of the TINI's ethernet address, this servlet helps eliminate any identity crisis your TINI may have been suffering. If any of the devices found is a Temperature 1-Wire device (ROM ID family code of 10h), TiniServlet will initiate a temperature conversion and display the results. This servlet will only run on a TINI. Sample output from TiniServlet can be seen here. This is a (slightly modified) copy of the output and not a live TINI.
OneWireServlet displays all of the ports and port adapters found on TINI. More information may be obtained for each port and port adapter combination found. Sample output from OneWireServlet can be seen here. This is a (slightly modified) copy of the output and not a live TINI. If there is a family code specific servlet for a 1-Wire device, OneWireServlet will display the device's ROM ID as a link to the family code specific servlet.
FamilyCode10Servlet is a family code specific servlet for family code 10 (hex) 1-wire devices. OneWireServlet will output a link to FamilyCode10Servlet for every 1-wire device it finds with a family code of 10 (hex). Family code 10 (hex) represents temperature reading devices (e.g. DS1920, DS1820).
FamilyCode12Servlet is a family code specific servlet for family code 12 (hex) 1-wire devices. OneWireServlet will output a link to FamilyCode12Servlet for every 1-wire device it finds with a family code of 12 (hex). Family code 12 (hex) represents dual addressable switch devices (e.g. DS2406,DS2407).
FamilyCode20Servlet is a family code specific servlet for family code 20 (hex) 1-wire devices. OneWireServlet will output a link to FamilyCode20Servlet for every 1-wire device it finds with a family code of 20 (hex). Family code 20 (hex) represents 1-wire quad A/D converters (e.g. DS2450).
Copyright © 1999-2002 Smart Software Consulting