Before going through the complete Servlet tutorial, it is better to understand tech jargons related to Servlets.
Following are some of the tech jargons related to Java Servlet technology,
- HTTP Request
- HTTP Response
- Request Methods
- HTTP Server
- Servlet Container
- Application Server
Hyper Text Transfer Protocol (HTTP)
HTTP is the corner stone of the World Wide Web(WWW). It is the protocol used to exchange hyper text between the client and server. The present version that is in popular use is HTTP/1.1. HTTP standards are defined by Internet Engineering Task Force (IETF) and World Wide Web Consortium (W3C). HTTP is a request-response based model. HTTP uses TCP connections over port 80 by default. HTTP is a stateless protocol. That means each and every request is processed individually and no state information is carried over from one request to another.
HTTP Request and Response
HTTP Request is a request from a client to a HTTP server. It contains the request method to be used, the resource identifier and protocol.
The server’s response to a HTTP request received. There processes the received HTTP request and sends back the HTTP response. It contains the response status code, response phrase, response header fields and the response message.
As part of the HTTP Request, the request method that should be applied on the resource will be sent. GET, POST, HEAD, PUT, DELETE and TRACE are those methods.
GET – Used to retrieve data and should not have any other effect on resource.
HEAD – Similar to GET method, but used to retrieve only the header information.
POST – Generally used to submit block of data enclosed in the request message body.
PUT – The enclosed entity to be stored in the server under the resource name given.
DELETE – To delete the specified resource.
TRACE – Request to echo back the sent request.
Sometimes ever referred to “Web Server”. Here we are meaning the software part of the server. The HTTP server stores, processes and delivers web pages to requesting clients. In other words, processes the HTTP request and responds with the HTTP response. Apache is an example of HTTP server.
Is a component is the application server, which loads the servlets and manages the servlet life cycle and responds back with the dynamic content to the HTTP server. Servlet container is used by the HTTP server for processing the dynamic content. Tomcat is an example for servlet container.
Java application server is an implementation of JEE specification container. It can be used for RMI, EJB, JMS, web services and for the whole JEE API stack. JBOSS is an example of application server.
This Servlet tutorial was added on 27/07/2014.