This servlet allows you to have some unique Id (session id) for the each visitor. This Id can be used for example for storing orders in your e-commerce site. The idea is pretty simple. All html-pages from your site passed through some servlet (why it can be called as an application server also). This servlet can replace some fields within your html with some generated value (like text macro). In this case the replacement is just that unique Id.
How it works:
For starting sessions you refers to your first page by this manner:
SessionIdServlet?page=your_first_page
For any page envolved in that process you can just replace any reference like
<a href=your_page ...
with
<a href=SessionIdServlet?id=@SessionId&page=your_page ...
within your pages you can use @SessionId as a macros at any place where
you need to
use your Id. E.g.:
<html>
<form action="http://some_your_script">
<input type="HIDDEN" name="Id" value="@SessionId">
...
</form>
</html>
In other words this servlet simulates URL rewriting.
Servlet's parameters.
You can set root directory for files as an initial parameter for servlet. Parameter's name is root. E.g.:
SessionIdServlet.initparams=root=/home/web/root
Note:
1. If you are using short file names in the FILE macro files will
be selected relatively the root directory of your servletrunner. Make sure
you select proper place for included files or use the full path or set root
parameter.
2. If the first line of your file is <!-- SessionIdServlet generated
--> such file will passed through servlet transparently (without preprocessing).
For downloading: SessionIdServlet.class