These notes describe the steps I took to install the SmartSC Servlet manager on a TINI internet appliance and write and compile my own servlet.
The Macintosh does not support class file libraries very well because of the 31-character file name limit. This prevented previous versions of TINIConvertor from accessing all classes. The version of TINIConvertor shipped with 1.0, however, now has jar file support which allows files with long filenames to be placed in a jar file and accessed correctly by TINIConvertor.
http://www.ibutton.com/TINI/
and unpack the distribution into a subfolder within the ServletSupport
folder (this is actually a bad idea but, for my initial experimentation,
it's easier to keep everything in one place.) You actually only need
the binary components from the TINI 1.0 distribution.
http://www.smartsc.com/tini/TiniHttpServer/
and unpack the distribution into a subfolder within the ServletSupport
folder. To build a servlet, you must (currently) link your servlet
with the ServletSupport library to create a single TINI binary image.
http://java.sun.com/products/servlet/download.html
. For Macintosh, choose the Windows/NT release 2.1.
servlet.jar from the Java distribution
to a convenient place in the ServletSupport directory,
renaming it smallservlet.jar.
smallservlet.jar. You will be removing a number
of classes that are not used, and others that are provided by
the SmallServlet distribution.
smallservlet.jar.
smallservlet.jar by
selecting each entry and selecting the Edit/Cut menu option:
javax/servlet/LocalStrings.propertiesjavax/servlet/ServletOutputStream.classjavax/servlet/http/Cookie.classjavax/servlet/http/HttpServlet.classjavax/servlet/http/HttpUtils.classjavax/servlet/http/LocalStrings.propertiesjavax/servlet/http/NoBodyOutputStream.classjavax/servlet/http/NoBodyResponse.classjavax/servlet/jsp/HttpJspPage.classjavax/servlet/jsp/JSPPage.classjavax/servlet/jsp (automatic)meta-inf/Manifest.mf (if found)meta-inf (directory, not extracted)javax/servlet/http/HttpSessionContext.class
servlet.jar that does
not conflict with the SmartSC Servlet Manager.
tini1.0 folder and its
children from the TINI distribution to the ServletSupport
directory.
ServletSupportbin (Created to store the generated tini image)tini1.0 (Holds the Tini 1.0 distribution)TiniHttpServer0.10 (SmartSC Servlet sources go here)smallservlet.jartini.jar
ServletSupport.mcp,
choosing the "JDK 1.1, java library" stationary. Delete the
TrivialClass.java file and delete it from the project.
| Target / Target Settings | |
| Target Name | Servlet Support |
| Linker | Java Linker |
| Pre-linker | None |
| Post-linker | None |
| Output Directory | {Project}: |
| Linker / Java MacOS Settings | |
| MacOS Java Output Type | MacOS Zip |
| Create 'old' MacOS resources | Unchecked |
| Create New File | Unchecked |
| Java Output | Jar File |
| Name | ServletSupport.jar |
| Compress | Unchecked |
| Generate Manifest | Unchecked |
Tini1.0/bin/tiniclasses.jar file to the project
by dragging the file to the project window.
smallservlet.jar file to the project by dragging
the file to the project window. This is the modified Java servlet
library created above.
src folder inside
the TiniHttpServer distribution folder to the ServletSupport
project window.
ServletSupport.jar file. This file, after conversion, will
be downloaded (uploaded?) to the TINI.
/bin/docs/logsTiniHttpServer.tini created by the previous steps.
(If TiniHttpServer is currently running on your TINI board, be sure
to stop it before overwriting the file.)
tini/docs/index.html from the HttpServlet
distribution (or your modified version) to
/docs/index.html.
tini/etc/server.props from the HttpServlet
distribution (or your modified version) to
/etc/server.props.
tini/etc/servlets.props from the HttpServlet
distribution (or your modified version) to
/etc/servlets/props.
tini/bin/TiniHttpServer from the HttpServlet
distribution (or your modified version) to
/bin/TiniHttpServer.
bin/TiniHttpServer.tini created above to
/bin/TiniHttpServer.tini
java /bin/TiniHttpServer.tini /etc/server.props &".
or "source /bin/TiniHttpServer"
MyServlet.mcp,
choosing the "JDK 1.1, java library" stationary. Delete the
TrivialClass.java file and delete it from the project.
Of course, replace "MyServlet" by the name you prefer.
| Target / Target Settings | |
| Target Name | MyServlet |
| Linker | Java Linker |
| Pre-linker | None |
| Post-linker | None |
| Output Directory | {Project}: |
| Linker / Java MacOS Settings | |
| MacOS Java Output Type | MacOS Zip |
| Create 'old' MacOS resources | Unchecked |
| Create New File | Unchecked |
| Java Output | Jar File |
| Name | MyServlet.jar |
| Compress | Unchecked |
| Generate Manifest | Unchecked |
tiniclasses.jar file to the project.
smallservlet.jar file to the project.
ServletSupport.jar file to the project.
src folder inside
the TiniHttpServer distribution folder to the project.
Remove any sample servlets that you don't need.
tini/docs/index.html from the HttpServlet
distribution (or a new version) and copy it to
/docs/index.html on the TINI. This file identifies your
servlet to the Servlet server.
tini/etc/servlets.props from the HttpServlet
distribution (or a new version) to add your new Servlet and set its
configuration parameters then copy it to /etc/servlets.props
on the TINI. This makes your servlet accessable to external users.
tiniclasses.jar,
smallservlet.jar, ServletSupport.jar
and the TiniHttpServer sources.
TINIConvertor to convert your servlet's .jar
file to the downloadable .tini file that will be transferred
to the TINI.
To run TINIConvertor on the Macintosh, you must either use JBindery to
launch TINIConvertor with the appropriate parameters or write a small
stub application that calls the TINIConvertor main method with the
parameters needed to create your servlet.
/bin directory. (I keep a separate Telnet session open
to do this.)
bin/TiniHttpServer.tini created above
to /bin/TiniHttpServer.tini on the TINI.
source /bin/TiniHttpServer to launch
the servlet manager and install the servlets. Alternatively, you
can use the direct command,
"java /bin/TiniHttpServer.tini /etc/server.props &".