Question : What is Servlet?
Definition 1: A small Java program that runs within a web server.servlets
receive and response to the request from the Web Clients usually across HTTP.
2) It runs completely inside the JVM.
Definition 2: A servlet is a java class therefore needs to be executed inside
the JVM, by a service we called Servlet engine.
Question: What is JSDK?
Answer: All servlets API classes and Simple servlet enables web server are
combined into Java Servlet Development Kit(JSDK).
Question :What are life cycle methods of the servlet interface?
Ans: The interface servlet defines the methods for the servlet life cycle. those are
1) init Method() : servlet constructed and initialized
2) service method() : calls from clients are handled here.
3) destroy method() : servlet is taken out of service and destroyed.
Question : Who calls the service() method ?
Ans: called by the servlet container to allow the servlet to handle the request.
Explain the Hierarchal of the servlets ?
Answer : Servlet [ interface
| implements
GenericServlet [ abstract Class ]
| extends
HttpServlet [ Abstract Class ]
|
---------> implements [ serializable ]
---------> implements [ servlet ]
----------> implements [ ServletConfig ]
Question : What is servlet Config?
Ans : It is an interface, used by the servlet container used to pass information to
servlet during initialization.
Question : What is servletContext ?
Ans : It is an Interface, used by the servlet to communicate with the servlet container
to get the information such as MIME type of a file , write to a log file.
Note: ServletContext is the object contained within the servletConfig object, where this
object is passed to the servlet by the servlet container during servlet initialization.
Note: There is only one context with the one web application or with one JVM.
Question : advantages of servlets over the CGI?
Answer : Platform Independent : because servlets written in java language.
Performance: CGI creates a new process to handle a new request,Servlet creates a new thread.
Hi, This blog is the place who want to prepare for programming interview with major product development companies. Apart from interview questions I would like to provide some concepts on the new technologies which I learn as part of my carrier. Thanks for visiting my Blog.
Sunday, November 28, 2010
Subscribe to:
Post Comments (Atom)
AWS certification question
AWS AWS Hi! this is for questions related to AWS questions. EC2 instances EC2 storage types cold HDD : 1. Defines performance in terms...
-
Here I am going to discuss some of the differences between Text and String class in Hadoop. Text class lies in the package: import org.ap...
-
Q: What is the library you used in spring to connect to database? Spring JDBC template. Q: What and all involved in fetching the data ...
-
There are 2 ways we can load data into the HIVE Tables. In this tutorial we are loading data into the HIVE managed Table. This is my sa...
No comments:
Post a Comment