How does a servlet
communicate with a JSP page?
The following code snippet shows how a servlet instantiates a bean and
initializes it with FORM data posted by a browser. The bean is then placed into
the request, and the call is then forwarded to the JSP page, Bean1.jsp, by means
of a request dispatcher for downstream processing.
What is the difference
between find and select methods in EJB?
A select method can return a persistent field (or a collection thereof) of a
related entity bean. A finder method can return only a local or remote
interface (or a collection of interfaces).
Because it is not exposed in any of the local or remote interfaces, a select
method cannot be invoked by a client. It can be invoked only by the methods
implemented within the entity bean class. A select method is usually invoked
by either a business or a home method.
A select method is defined in the entity bean class. For bean-managed
persistence, a finder method is defined in the entity bean class, but for
container-managed persistence it is not.
What is the difference
between JavaBean and EJB?
A Java Bean is a software component written in the Java programming language
that conforms to the JavaBeans component specification. The JavaBeans APIs
became part of the “core” Java APIs as of the 1.1 release of the JDK.
The JavaBeans specification defines a Java-based software component model
that adds a number of features to the Java programming language. Some of
these features include:
Enterprise JavaBeans (EJBs) are Java-based software components that are
built to comply with Java’s EJB specification and run inside of an EJB
container supplied by a J2EE provider. An EJB container provides distributed
application functionality such as transaction support, persistence and
lifecycle management for the EJBs.
What is abstract schema?
Abstract schema is part of an entity bean’s deployment descriptor which
defines the bean’s persistent fields and their relationship. Abstract schema
is specified for entity beans with container managed persistence. We specify
the name of the Abstract schema name in the deployment descriptor. The
queries written in EJB QL for the finder methods references this name. The
information provided in this Abstract Schema is used by the container for
persistence management and relationship management.
What is local interface.
How values will be passed?
An EJB can use local client view only if it is really guaranteed that other
enterprise beans or clients will only address the bean within a single JVM.
With local client view, you can do pass-by-reference, which means your bean,
as well as the client, will work directly with one copy of the data. Any
changes made by the bean will be seen by the client and vice versa.
Pass-by-reference eliminates time/system expenses for copying data
variables, which provides a performance advantage.
What is Message Driven
An MDB is essentially a message consumer that can listen to a message
destination or a message endpoint and gets activated when a message arrives.
By design, MDBs are anonymous in nature and hence cannot be directly invoked
by a client. The only way to invoke an MDB is to send a message to the
destination or endpoint to which it is listening. As MDBs are stateless in
nature and are not related to any specific client, they can be pooled for
concurrent processing of messages.
What are the call back
methods in Entity bean?
Callback methods allows the container to notify the bean of events in its
life cycle. The callback methods are defined in the javax.ejb.EntityBean
What are the services
provided by container?
Container services are totally depends upon the “vendor implementation”. But
more or less most of the vendors suppots the basic services like,
LifeCycle Management - It is Automatic.
Session Management - it is used by Developer coded callback methods…
Transaction Management - it is used by configuring deployment descriptor
Security management - it is used by configuring deployment descriptor (DD) .
The other services, if any will be in advanced versions, and depends on
What is deployment
Deployment descriptor is a XML file. which is used to locate the web
applicatio n by container.it includes the details of respective bean.
How many EJB Objects are
created for a Bean?
For a Session bean - one EJB object for one bean instance.
For entity bean - it depends , if 2 users are accessing one row at time then
one EJB object is used for both the beans other wise for each bean one EJB
What is re-entrant. Is
session beans reentrant. Is entity beans reentrant?
If we define the entity bean as being reentrant, multiple clients can
connect to the Entity bean & execute methods within the entity bean
concurrently. Container takes care of synchronization. If we define the
entity bean as non-reentrant and many clients connect to it concurrently to
execute a method, exception is thrown .
Page Numbers :