Servlet
Servlet is a component based, platform independent technology for build the web application.Initially Common Gateway Interface (CGI) server-side scripts were the main technology for build web application with dynamic content.Although widely used CGI scripts had many shortcoming, including platform dependence and lack of scalability. To address these limitations, Java Servlet Technology was created as a portable way to provide dynamic content.Java Servlet Technology is used to create Dynamic web applications which runs on a web or Application server (like Tomcat, JBos, Web Logic,…).Servlet is Three Tier Component Technology.The Three Layers are
- HTTP Server
- Servlet Program
- Database
Advantage of Servlet
Servlet has many advantage over CGI. Servlet can handle multiple request.The web container creates thread for handling multiple requesting coming from different web browser or HTTP client or application runs on HTTP server .CGI creates process. Threads have a lot of advantages over the processes. Threads can share the common memory, lightweight, cost of communication between threads are low.
- Platform Independent
- Portability
- High Performance : – it creates thread for each request not process.
- Secure
- Robust
Servlet Packages
The javax.servlet and javax.servlet.http packages provide interface and classes for create the servlet.All the servlet must implement the Servlet interfaces, which defines lifecycle methods.
Types of Servlet
- GenericSerlvet – you can use when implementing a generic service
- HttpServlet – you can use to handle HTTP-specific services.
0 comments:
Post a Comment