Computer Knowledge

Java Enterprise and Web Technologies

2,279 Questions

Java enterprise and web technologies questions focus on J2EE architecture, web services like SOAP, and servlet functionalities. These topics frequently appear in IT officer and specialist scale examinations. Regular practice ensures familiarity with enterprise application components.

HttpServlet methodsSOAP and web servicesEJB architecture rolesJ2EE componentsJSP servlet callingUDDI concepts

Java Enterprise and Web Technologies Questions

Multiple choice technology embedded technologies
  1. bean

  2. objects

  3. classes & nterfaces

  4. methods

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

An Enterprise JavaBean (EJB) component is defined by a set of Java classes and interfaces, such as the bean implementation class, home interface, and component interface. Together, these define the EJB's lifecycle and client interactions, making this option the only complete definition.

Multiple choice technology embedded technologies
  1. store & retrieve data

  2. call back the method

  3. reside in different mechanism

  4. hold the correct informtion

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

EJB components, particularly entity beans, provide standard mechanisms to store and retrieve persistent business data from a database. While EJB supports distributed deployments, the primary service defined in this context is data storage and retrieval, making the other options incorrect.

Multiple choice technology embedded technologies
  1. Session bean

  2. Entity bean

  3. Message Driven bean

  4. Object bean

Reveal answer Fill a bubble to check yourself
A,B,C Correct answer
Explanation

Enterprise JavaBeans (EJB) specification defines exactly three types of beans. Session beans encapsulate business logic and workflow. Entity beans represent persistent business data (now largely replaced by JPA entities). Message-driven beans handle asynchronous messaging via JMS. 'Object bean' is not a standard EJB type.

Multiple choice technology embedded technologies
  1. Session bean method

  2. Entity bean method

  3. Message driven method

  4. Object Bean method

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Clients interact with session beans to access application business logic. Session beans serve as the client-facing business interface. Entity beans (in EJB 2.x) are for persistence and not directly invoked by clients. Message-driven beans process asynchronous messages and are also not directly invoked by clients.

Multiple choice technology embedded technologies
  1. stateless

  2. statefull

  3. BMP

  4. CMP

Reveal answer Fill a bubble to check yourself
A,B Correct answer
Explanation

Session beans are categorized into exactly two types: stateless session beans (no conversational state maintained between calls, can be pooled) and stateful session beans (maintain client-specific state across method invocations). BMP (Bean-Managed Persistence) and CMP (Container-Managed Persistence) are persistence mechanisms for entity beans, not session bean types.

Multiple choice technology embedded technologies
  1. Beans need to hold information

  2. retrieve data

  3. connect the client

  4. No data for a specific client

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Stateless session beans are used when business operations don't require maintaining client-specific data between method calls. They're more efficient as they can be pooled and shared across clients. Option D correctly describes this scenario. Options A and B suggest scenarios where state might be needed (better for stateful beans). Option C is irrelevant.

Multiple choice technology embedded technologies
  1. No data for a client

  2. Beans needs to hold information across method invocations.

  3. when business object should be stored

  4. to send data for a specific application

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Stateful session beans are specifically designed to maintain conversational state with a specific client across multiple method invocations. This makes them ideal for multi-step workflows like shopping carts or wizard-style processes. Option B correctly describes this use case. Option A describes stateless beans. Options C and D are misleading.

Multiple choice technology embedded technologies
  1. when business object should be stored in persistant storage mechanism.

  2. if information have to be passed from one group to other.

  3. to review the data in other application

  4. to check with the client.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Entity beans are designed to represent business objects that need persistent storage - data that survives beyond application sessions. Option A correctly states this purpose. Entity beans map to database tables and handle CRUD operations. Options B, C, and D describe other concerns (communication, review, validation) not related to persistence.

Multiple choice technology embedded technologies
  1. simple instances

  2. classes and objects

  3. getter and setter methods

  4. business application

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

EJB specifications, particularly for stateless session beans, state that these beans do not maintain conversational client state and should not contain custom instance variables. Instead, they are deployed as simple instances managed by the container's pool to execute stateless business methods.

Multiple choice technology embedded technologies
  1. message driven bean

  2. entity bean

  3. stateles session bean

  4. stateful session bean

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Message-driven beans (MDBs) do not expose remote or local client interfaces. Instead, they act as asynchronous message listeners that the EJB container invokes when messages arrive at their designated queue or topic. Session and entity beans require interfaces for clients to invoke their business methods.

Multiple choice technology embedded technologies
  1. JMS

  2. JAXM

  3. BMP

  4. CMP

Reveal answer Fill a bubble to check yourself
C,D Correct answer
Explanation

Entity beans in EJB 2.x support two persistence mechanisms: BMP (Bean-Managed Persistence) where the developer writes all database code, and CMP (Container-Managed Persistence) where the container handles persistence automatically. Options C and D correctly identify these. JMS and JAXM (A and B) are messaging technologies unrelated to entity bean persistence.

Multiple choice technology programming languages
  1. Servlet Interface

  2. servlet mapping

  3. Servlet Container

  4. None of the Above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

All servlets must implement the javax.servlet.Servlet interface, either directly or by extending a class like GenericServlet or HttpServlet which already implements it. The Servlet interface defines the lifecycle methods (init, service, destroy) that all servlets must support.

Multiple choice technology programming languages
  1. Servlets are server side components

  2. Applets have GUI interface

  3. Servlets have GUI interface

  4. Applets are client side components

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The false statement is C - Servlets do NOT have GUI interfaces. Servlets are server-side components that generate dynamic content but run without any GUI. In contrast, applets are client-side components that DO have GUI interfaces.