Adding new Servlets is a task which can be done in seconds. We will talk later about advanced techniques; for now we simply like to get a servlet running.
- Create a new configuration file for your servlet by copying sv_demo.ini
to sample.ini .
- In the new configuration change at least this parameters to new values:
servletidentifier
processname
class
- Add this new configuration file to runner.ini by adding
a line like
servlet_cfg=sample.ini
- Restart the servlet runner as described before.
Example
As an example, we will install the Webmail Servlet from ColdBeans software.
- Download the WebMail.class, smtpMail.class and
mailconf from http://coldjava.hypermart.net/servlets/webmail.htm
- Copy the downloaded files to your runner directory (c:\runner\
for example)
- Edit mailconf (at least the dir parameter
dir=c:\\runner\\)
- Copy sv_demo.ini to webmail.ini
- Edit webmail.ini :
servletidentifier = /webmail
processname=webmail
class = WebMail
config.config = c:\\runner\\mailconf
- Edit runner.ini :
Add a line named servlet_cfg=webmail.ini somewhere or near the existing
servlet_cfg entry.
- Restart Sokrates as described in the previous chapter.
- Try http://127.0.0.1/webmail
It isn't really working because you have to edit mailconf according
to the description on the homepage of the software but its enough for a sample.
|