Introduction of Servlet
Servlets – It is a kind of server side scripting, server side validations, server side programming, server side processing. used to create the dynamic web pages.(optional)
It is a kind of server side Technology, use to host dynamic data on the web server.
Servlet technology is generally to generate web application with dynamic web page.
Servlet can be performed as a CGI (Common Gateway Interface) with scripting language.
In this server side scripting languages are used many interfaces and classes in the servlet API such as Servlet, GenericServlet, HttpServlet, ServletRequest, ServletResponse
What is web application?
A web application is an application accessible from the web. A web application is composed of web components like Servlet, JSP, Filter etc. and other components such as HTML. The web components typically execute in Web Server and respond to HTTP request.
CGI(Common Gateway Interface)
In CGI technology can be enables the web server to call an external program and pass HTTP request information to the external program to process the request. For each request, it starts a new process.
There are some important statemnent of Servlet
- To create web application.
- Many interfaces and classes are used.
- To create dynamic web page and deployed on the server
Advantage of Servlet
- better performance: Due to it creates a thread for each request not process.
- Portability: because it uses java language.
- Robust: Servlets are managed by JVM so no need to worry about momory leak, garbage collection etc.
- Secure: because it uses java language..
Disadvantages of CGI
- If number of clients increases, it takes more time for sending response.
- For each request, it starts a process and Web server is limited to start processes.
- It uses platform dependent language e.g. C, C++, perl.