Servlet is an extended and web-based application developed using Java programming language which was initially launched in 1996. Servlets can be used to handle various types of request, but it is mostly used with web-applications, and it is also seen as the counterpart of PHP, Perl, ASP.Net which are the popular server-side-scripting and programming languages. Servlets can be used to create simple dynamic-websites to the advanced complex operations based dynamic web-portals where HTML, CSS and JavaScript help the web developers and designers to craft their web-pages beautifully.
Servlet runs in a web browser with the help of a web-server like Tomcat which is popularly used as an HTTP-web server and Java Virtual machine in the background that includes both JDK and JRE. There are several open-source and paid Integrated Development Environments (IDEs) available on the Internet using which you can quickly develop Servlet based applications.
There are various methods to compile and run Servlet applications such as:
How to compile Servlets from CMD or Console?
To compile Servlets from CMD or Console:
javac -classpath C:\apache-tomcat-7.0.23\lib\servlet-api.jar YourServlet.java