by Dinesh Thakur Category: introduction to Servlet

The Common Gateway Interface (CGI) is the first technology used to generate dynamic contents. It allows a web client to pass data to the application running on the web server so that a dynamic web page can be returned to the client according to the input data. For example, when you use a search engine, buy a book at an online store; get a stock quote etc., your browser uses CGI to communicate with a server side application.



 
by Dinesh Thakur Category: introduction to Servlet

Java Servlet life cycle consists of a series of events that begins when the Servlet container loads Servlet, and ends when the container is closed down Servlet. A servlet container is the part of a web server or an application server that controls a Servlet by managing its life cycle. Basically there are three phases of the life cycle.



 
by Dinesh Thakur Category: introduction to Servlet

Before creating the first servlet, you need to understand the Servlet API and Tomcat Servlet container. The Servlet API provides interfaces and classes that are required to built servlets. These interfaces and classes are group into the following two packages :



 
by Dinesh Thakur Category: introduction to Servlet

Java servlets provide web developers with a simple consistent mechanism for extending the functionality of a web server and provide dynamic behaviour for web applications. Servlets are Java classes that function like CGI programs. They accept a request from a client (usually a web browser), process that request and return a response to the client. All servlets are loaded and executed by a servlet container that can run by itself or as a component of a web server. The servlet container is also referred to as a servlet engine in the early days of servlet technology.



 
by Dinesh Thakur Category: introduction to Servlet

In Java, Servlet container (also known as aWeb container) generates dynamic web pages. So servlet container is the essential part of the web server that interacts with the java servlets. Servlet Container communicates between client Browsers and the servlets.



 
by Dinesh Thakur Category: introduction to Servlet

There is a possibility of developing ‘n’ types of servlets, like httpservlet, ftpservlet, smtpservlet etc. for all these protocol specific servlet classes GenericServlet is the common super class containing common properties and logics. So, GenericServlet is not a separate type of servlet.



 
by Dinesh Thakur Category: introduction to Servlet

In doGet Method the parameters are appended to the URL and sent along with the information. Maximum size of data that can be sent using do Get it 240 bytes. Parameters are not encrypted. doGet method generally is used to query or to get some informationfromthe server.



 
by Dinesh Thakur Category: introduction to Servlet

All of us would have started programming in java with the famous "hello world" program. If you can recollect, we saved the file with a '.java' extension and later compiled the program using 'javac' and then executed the program using 'java'. Apart from introducing you to the language basics, the important point is that it is a client-side program. That means you write, compile and execute the program in the client machine (i.e., your PC). No doubt, it is the easiest and fastest way to write, compile and execute the program. However, it has little practical significance when it comes to real-world programming.



 
by Dinesh Thakur Category: introduction to Servlet

The three important resources of servlet API.

1. javax.servlet.Servlet

2. javax.servlet.GenericServlet      (Abstract class)

3. javax.servlet.http.httpServlet    (Abstract class)



 
by Dinesh Thakur Category: introduction to Servlet

A web resource application is a combination of static as well as dynamic web resource programs, images, etc. A static web resource resides in server and is executed in client side web browser, e.g., HTML. A dynamic web resource program resides in server, is executed in context of server and gives response back to the client, e.g., servlet, JSP. In web application, static web resource takes data from client side and takes it to the dynamic web resource as per request. The dynamic web resource processes the data and sends the response back to client in the form of response.



 

Page 1 of 4

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Search Content