The Espressif ESP8266-01 module is dirt cheap but only has two (four if you don’t need Tx/Rx) digital pins and no analog pins. Nevertheless, it still has its usage if you only need digital I/O. You can control up to four actuators via the digital pins (GPIO set to output) or control the status of windows and doors (GPIO input). There are many cases (at least in a SmartHome environment) when there is no power supply within decent reach of a sensor, so running the ESP module on battery is crucial. I will only provide a few links which cover this issue, since my focus in this article is on establishing a communication link to and from an Apache Tomcat server.
Apache Tomcat is public domain, and it is available on Linux and Windows. I will not cover the installation of Apache Tomcat in either of these environments. So make sure you have a running instance of it before you start following the instructions.
You need a software development environment. I’m using Eclipse on a Windows workstation PC and a ZOTAC miniPC which runs Linux server. On this Linux server I installed and configured Tomcat revision 8.0. As I already mentioned, Tomcat is also available on Windows, so you could install Tomcat on your Windows development workstation. Which option you choose doesn’t make much difference. Any running Tomcat server instance which you are able to deploy your code to will do.