Servlets / JSP

Introduction to Servlets / JSP

Web applications run on a server where they can service (browser)clients through an HTTP-server. These applications consist of regular HTML, images and servlets/JSP's that can produce HTML (and other content), most often based on data from a database.
A web application is deployed in a Web Archive, a .war, a zipped file, to a servlet container, like Tomcat, or to an Application Server, like Geronimo or Websphere.
Developing web applications is easy with Eclipse plus Web Tools and Tomcat. After installing the Eclipse IDE for EE you can create a Web Application Project through File, New, Other, Web, Dynamic Web Project, name it and choose Tomcat as Target Runtime.
To begin with a servlet, choose File, New, Other, Web, Servlet. After building (the source code is in the src folder), you can choose Run, Run as, Run on server and if the wind blows in the right direction, you'll get to see the servlet's result in a browser window.
A separate HTTP-server is not needed for testing, since Tomcat can fulfill that role, listening on port 8080.