Tomcat - robbiehume/CS-Notes GitHub Wiki
- Tomcat is a web server and Servlet container for Java code
- 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
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:
- https://www.geeksforgeeks.org/difference-between-servlet-and-jsp/
- Servlets write HTML inside of Java; JSPs write Java inside of HTML
- Servlets are faster than JSP
- Servlets can except all protocol requests; JSP can only accept HTTP requests