A servlet is a web component that generates dynamic content. Servlets are small, platform independent
Java classes compiled to an architecture-neutral bytecode that can be loaded dynamically into and run by a servlet container. Servlets interact with web clients via a request-response paradigm implemented by the servlet container. This request-response model is based on the behavior of HTTP. Servlets allow state, can use the JDBC API, and have a significant performance increase because they have no heavy process startup and initialization for each client request as CGI does.
According to Sun , a servlet is a Java programming language class used to extend the capabilities of servers that host applications accessed via a requestresponse programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers. For such applications, Java servlet technology defines HTTP-specific servlet classes. The javax.servlet and javax.servlet.http packages provide interfaces and classes for writing servlets. All servlets must implement the Servlet interface, which defines life-cycle methods.
Web and java servlet technology
Servlets can be used for any number of web-related applications. Let’s look at a few examples. Developing e-commerce “store clients” has become one of the most common uses for Java servlets. A servlet can build an online catalog based on the contents of a database. It can then present this catalog to the customer using dynamic HTML. The customer will choose the items to be ordered, enter the shipping and billing information, and then submit the data to the servlet. When the servlet receives the posted data, it will process the orders and place them in the database for fulfillment. Every one of these processes can be easily implemented using Java servlets.
Servlets can be used to deploy websites that open up large legacy systems on the Internet. Many companies have massive amounts of data stored on large mainframe systems. These businesses do not want to re-architect their systems, so they choose to provide inexpensive web interfaces into them. Because you have the entire JDK at your disposal and security provided by the servlet container, you can use servlets to interface with these systems using anything from Transmission Control Protocol/Internet Protocol (TCP/IP) to Common Object Request Broker Architecture (CORBA).
The following is a skeleton of a servlet:
HttpServlet (defined in the javax.servlet.http package) is an abstract class to be subclassed to create an HTTP servlet suitable for a website. A subclass of HttpServlet must override at least one method, usually one of these:
Figure shows one of the most common ways of using a Java servlet. A user
Most common way of using a java servelet.
JDBC Related Interview Questions
|Core Java Interview Questions||JSP Interview Questions|
|Java Servlets Interview Questions||EJB(Enterprise JavaBeans) Interview Questions|
|JSTL(JSP Standard Tag Library) Interview Questions||JNDI (Java Naming and Directory Interface) Interview Questions|
|Java Bean Utils Interview Questions||AWT (Abstract Window Toolkit) Interview Questions|
What Is Jdbc Programming?
Database Metadata, Part 1
Database Metadata, Part 2
Exploring Driver Property Information
Rowset Metadata A
Web Access To Metadata,part 1
Web Access To Metadata, Part 2
Rdf And Jdbc Metadata
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.