“Fat Client Tomcat” – Running Tomcat locally…
In certain industry scenarios it is required to run application logic directly on the front end computer. Example: in a production line certain workplaces need to be independent from any network and/or server failures.
In this case a local installation of the Tomcat server environment is one option to choose.
Running Tomcat locally typically is not totally liked by users/administrators:
- Either you start the Tomcat environment as system service – in this case it is hidden to the user. Or you start the Tomcat environment via batch script and then the user sees some not-nice DOS-box.
- In any way the user needs to open the browser and needs to call the correct URL (to the localhost-Tomcat) – so starting the local application is not really simple.
So isn’t there a way to start the local installation (Tomcat + Browser) in a smoother way – so that it is similar to a locally running desktop application?
Of course there are some ways, one of them being shown here: we provide a mini-Java program in which a Tomcat instance is started within a dialog. The dialog in addition provides a button to call the right URL:
So the user may start this program by double clicking a normal desktop icon. The dialog will internally (within the VM of the dialog) start Tomcat. All protocol of Tomcat + of the contained applications which normally is sent to the terminal is captured and output within the text area of the dialog.
There are some start parameters:
- tomcatdir=… – The Tomcat directory. (mandatory)
- url=… – The URL to start. (mandatory)
- title=… – The title of the dialog. (optional)
- buttontext=… – The text of the button. (optional)
- checkport=… – Port number to explicitly check before internally starting Tomcat. If the check fails then the user received some proper error message – and does not have to search through the Tomcat messages.
For starting the dialog:
- …use “javaw” so that Java is started without own DOS-box (which always confuses users)
- …include the jar files tomcat/bin and tomcat/lib into the class path
The Java source code is available through the following link: