Java is a general purpose programming language with a number of features that make the language well suited for use on the World Wide Web. Small Java applications are called Java applets and can be downloaded from a Web server and run on your computer by a Java-compatible Web browser.
Java has strong support for web development. While Java on the desktop, with the notable exception of Eclipse RCP based application was never a huge success, Java is frequently used at the server side. Java web applications are typically not running directly on the server. Java web applications are running inside a web container on the server.
The container provides a runtime environment for Java web applications. The container is for Java web applications what the JVM (Java Virtual Machine) is for local running Java applications. The container itself runs in the JVM.
In general, Java distinguishes two containers: the web container and the Java EE container. Typical web containers in the Java world are Tomcat or Jetty. A web container supports the execution of Java servlets and Java Server Pages. A Java EE container supports additional functionality, for example, distribution of server load.
Most of the modern Java web frameworks are based on servlets. Popular Java web frameworks are GWT, Java Server Faces, Struts and the spring framework. These web frameworks usually require as a minimum container a web container
Make Presentation or Service Oriented Web Applicationsoverview of the standard web technologies for Java. It explains the terms web applications, servlets, JSPs and web container.