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
  1. deploying ruleapps

  2. monitoring rules execution

  3. deploying rule projects

  4. BOM to XOM mapping

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

Rule Execution Servers handle runtime operations: deploying packaged ruleapps and rule projects, and monitoring their execution. BOM (business object model) to XOM (execution object model) mapping is a build-time transformation performed by development tools like Rule Studio, not the execution server.

Multiple choice technology architecture
  1. They are components.

  2. A container manages them.

  3. More than one of them can be combined in a single program (not application).

  4. They live on the server side of an application.

  5. They can be part of a transaction.

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

Enterprise JavaBeans (EJBs) differ from regular JavaBeans in three key ways: EJBs are managed by an EJB container that handles lifecycle, security, and transactions; they execute on the server side in application servers; and they can participate in distributed transactions. Regular JavaBeans are simple reusable components that run client-side without container management.

Multiple choice technology architecture
  1. Acknowledge receipt of the request to the client

  2. Start a transaction

  3. Check security for the client

  4. Discard the request.

  5. Directly and immediately pass the request to the bean's methods.

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

When a request arrives for an EJB method, the container performs several preprocessing tasks before invoking the bean: it can start a transaction context if the method requires one, and it checks security credentials to verify the client's authorization. The container does not simply pass requests directly - it provides these middleware services first.

Multiple choice technology architecture
  1. There is a many-to-one relationship between the client and the session bean instance.

  2. Session bean instances live forever.

  3. The container may discard the bean instance arbitrarily, when and if it needs to, for performance reasons.

  4. Stateful session beans may have initial state information passed to them from the client when they are created.

  5. Stateful session bean intances are created when the bean is deployed in the container.

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

Stateful session beans maintain conversational state with a specific client. The correct answer is D because stateful session beans can receive initial state information through arguments in their create methods. Option A is incorrect because while there's a relationship, it's not accurately described as many-to-one. Option B is false because bean instances have a finite lifecycle. Option C is incorrect because the container doesn't arbitrarily discard stateful beans - passivation/activation follows specific rules. Option E is false because instances are created on client demand, not deployment.

Multiple choice technology architecture
  1. Clients of entity beans have a one-to-one relationship with entity bean instances.

  2. Entity bean instances may not be discarded by the container if it needs to free up resources.

  3. Each entity bean instance has a unique identity.

  4. Entity beans map to one or more pieces of data, each one of which has a unique primary key.

  5. None of above

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

Entity beans represent persistent business data. Option D is correct because entity beans represent persistent data with unique primary key identification. Option A is incorrect because multiple clients can access the same entity bean instance. Option B is false because containers can discard/passivate entity beans to manage resources. Option C is misleading because while instances have identity within the container, the question's phrasing is imprecise. Entity beans fundamentally exist to represent data in persistent storage.

Multiple choice technology architecture
  1. True

  2. False

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

Entity beans represent data in persistent storage that can be accessed by multiple clients concurrently. The answer is False because entity beans do NOT have a one-to-one relationship with clients. Multiple clients can access the same entity bean instance (representing the same underlying data) simultaneously. Entity beans are designed for shared access to persistent data, unlike stateful session beans which maintain exclusive conversational state with one client.

Multiple choice technology architecture
  1. True

  2. False

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

In EJB, a bean's remote interface can extend other remote interfaces using Java's extends clause. This is True because remote interfaces are standard Java interfaces that follow normal inheritance rules. A bean's remote interface can extend from other remote interfaces (or regular interfaces), allowing interface hierarchies and code reuse. The bean implementation class then implements this extended interface, inheriting all method signatures.

Multiple choice technology architecture
  1. True

  2. False

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

EJB callback methods like ejbCreate and ejbRemove have standardized signatures in the EJB specification, but their internal implementation varies by application server vendor. The answer is True because while the API contract is the same (method names, signatures, and behavior requirements), each vendor (WebLogic, JBoss, WebSphere, etc.) implements these differently internally. The container manages the bean lifecycle, and vendor implementations optimize this differently.

Multiple choice technology architecture
  1. True

  2. False

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

Message Driven Beans (MDBs) share structural similarities with Session Beans. The answer is True because MDBs follow the same lifecycle callback pattern (ejbCreate, ejbRemove) as session beans, and they're also managed by the container. The key difference is MDBs don't have a client-visible interface - they respond to JMS messages instead of direct client calls. But structurally, they mimic session bean patterns for lifecycle management.

Multiple choice technology programming languages
  1. A browser that uses a plug-in to process user data.

  2. A distributed application where the client program does not process data, but instead passes data for processing to an enterprise bean running on an application server

  3. An application that cannot be stopped by firewall

  4. An application compiled with the thin option of the javac command

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

A thin-client application is characterized by minimal processing on the client side. The client primarily handles the user interface and passes data to server-side components (like enterprise beans) for actual business logic and data processing. This reduces client-side resource requirements.

Multiple choice technology programming languages
  1. Special icons for creating the user interface elements for thin clients

  2. A data module saved to the component area of the database.

  3. A self-contained functional software unit that is assembled into a J2ee application and interfaces with other application components

  4. A JAR file

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

A J2EE component is a self-contained, reusable software unit that is assembled into a J2EE application. Components like EJBs, servlets, and JSPs have defined interfaces and interact with other components through containers, enabling modular enterprise application development.

Multiple choice technology programming languages
  1. Entity-bean data survives crashes.

  2. An entity-bean represents non-persistent data.

  3. It creates its own JAR file during deployment

  4. You get authentication code without having to write any.

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

Entity beans represent persistent business data that survives system crashes because they are backed by a database. Session beans, in contrast, are transient and only exist for the duration of a client session, representing business processes rather than persistent state.

Multiple choice technology programming languages
  1. When you want to be certain your application data persists between program invocations , even in the event of a crash

  2. If you need to initiate a database transaction

  3. To process transient data that can be re-created in the event of a crash.

  4. to keep people who do not know how to program , from accidentally changing important logic code.

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

Session beans are designed for transient, short-lived operations that don't need to survive crashes. They process business logic that can be restarted if lost. Persistence between program invocations requires entity beans or database storage. Database transactions can be initiated from various components, not just session beans.

Multiple choice technology programming languages
  1. To make the user interface more interesting.

  2. To simplify application deployment.

  3. To prevent malicious programs from gaining access to sensitive information on your database server.

  4. To make the application much easier to update, maintain, and manage

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

Separating user data entry (JSP) from business logic (JavaBeans) follows the Model-View-Controller pattern, making applications easier to maintain and update. Changes to the UI (JSP) don't affect business logic (JavaBeans), and vice versa. This is about maintainability, not security, deployment, or visual interest.