In order to execute a Java application, A web or application server having a servlet container is required. A web server knows only how to intercept HTTP requests and how to return contents of static web pages. It doesn’t know how to execute servlets. A servlet container extends the functionality of a web server by […]
Read complete post
Get request is designed to fetch (read) contents from the server and the Post request is designed to submit (save or update) contents on the server. This perspective of receiving and giving provides the base for understanding all their differences. Difference between get and post request: In get request, data are sent as part of the […]
Read complete post
In the current information age, web sites have become an important tools in the hands of governments, business organizations and individuals to reach out to their target audiences beyond geographical boundaries. In a simple, technical jargon free and easy to understand way: A web site is a collection of web pages which are stored on […]
Read complete post
A servlet class can be defined by directly implementing the Servlet interface or by extending a helper class javax.servlet.GenericServlet provided by servlet API. It is an abstract class, which implements Servlet interface and defines all its methods except service() i.e. In its sub class, an application programmer need to define only the service method. Following […]
Read complete post
Servlet life cycle describes how and when a servlet object is created and initialzed, how it processes requests and how and when it is destroyed by the server. Servlet life cycle is defined by javax.servlet.Servlet interface. Life cycle methods of Servlet interface: init(): This method is invoked by the web server only once, just after […]
Read complete post
The term Servlet has two different meaning in two different contexts. In the broader context, it represents an API of dynamic web application development and in the narrow context, it represent a Java class which is defined using this API for processing requests in a web application. As API, Servlet contains interfaces and classes which […]
Read complete post
What is a cookie? A cookie is a token which is generated by the server or a servlet and is sent as part of the response to be received back from the client as part of the subsequent requests. This token contains some information of the client in the form of key-value pair. What is […]