Thursday, May 8, 2008

JSP Servlet J2EE Questions 6

26: What is the difference between HttpServlet and GenericServlet?
A: A GenericServlet has a service() method aimed to handle requests.
HttpServlet extends GenericServlet and adds support for doGet(), doPost(), doHead()
methods (HTTP 1.0) plus doPut(), doOptions(), doDelete(), doTrace() methods (HTTP
1.1). Both these classes are abstract.

27: What is the difference between ServletContext and ServletConfig?
A: ServletContext: Defines a set of methods that a servlet uses to communicate
with its servlet container, for example, to get the MIME type of a file, dispatch
requests, or write to a log file.The ServletContext object is contained within the
ServletConfig object, which the Web server provides the servlet when the servlet is
initialized

ServletConfig: The object created after a servlet is instantiated and its default
constructor is read. It is created to pass initialization information to the
servlet.

28: What are the different kinds of enterprise beans?
A: Different kind of enterrise beans are Stateless session bean, Stateful

session bean, Entity bean, Message-driven bean...........

29: What is Session Bean?
A: A session bean is a non-persistent object that implements some business
logic running on the server. One way to think of a session object...........

30: What is Entity Bean?
A: The entity bean is used to represent data in the database. It provides an
object-oriented interface to ...........

No comments:

Useful Information