Tomcat - robbiehume/CS-Notes GitHub Wiki

Overview:

  • Tomcat is a web server and Servlet container for Java code

Tomcat vs Apache HTTP Server

  • The purpose of Apache is to simply serve static files such as text, HTML, images, audio, and video files to web-based clients
  • In contrast, Tomcat delivers content that changes upon who the client is, whether the client has signed in, and what the client has done on previous interactions with the server

Java Servlets vs JSP (Java Server Pages)

Servlets

  • Servlets are server-side programs written in Java, which implement the Servlet interface and handle all client requests to that server
  • Servlet acts as the middle layer between the client requests and the applications located on that server
  • Servlets are used to collect data from the users (e.g. forms) and also to create web pages dynamically and present the results

JSPs

  • JSPs are similar to Servlets and are used to create web applications
  • It is kind of similar to PHP
  • JSPs can be viewed as extensions of Servlets, as JSP is easier to maintain and provides more functionalities
  • JSPs create webpages by inserting Java code into HTML pages inside <% %> tags

Differences:

⚠️ **GitHub.com Fallback** ⚠️