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
-
IRL mapping
-
Extender class
-
External file mapping
-
map files
-
deploying ruleapps
-
monitoring rules execution
-
deploying rule projects
-
BOM to XOM mapping
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.
-
They are components.
-
A container manages them.
-
More than one of them can be combined in a single program (not application).
-
They live on the server side of an application.
-
They can be part of a transaction.
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.
-
Acknowledge receipt of the request to the client
-
Start a transaction
-
Check security for the client
-
Discard the request.
-
Directly and immediately pass the request to the bean's methods.
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.
-
There is a many-to-one relationship between the client and the session bean instance.
-
Session bean instances live forever.
-
The container may discard the bean instance arbitrarily, when and if it needs to, for performance reasons.
-
Stateful session beans may have initial state information passed to them from the client when they are created.
-
Stateful session bean intances are created when the bean is deployed in the container.
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.
-
Clients of entity beans have a one-to-one relationship with entity bean instances.
-
Entity bean instances may not be discarded by the container if it needs to free up resources.
-
Each entity bean instance has a unique identity.
-
Entity beans map to one or more pieces of data, each one of which has a unique primary key.
-
None of above
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.
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.
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.
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.
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.
-
A browser that uses a plug-in to process user data.
-
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
-
An application that cannot be stopped by firewall
-
An application compiled with the thin option of the javac command
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.
-
Special icons for creating the user interface elements for thin clients
-
A data module saved to the component area of the database.
-
A self-contained functional software unit that is assembled into a J2ee application and interfaces with other application components
-
A JAR file
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.
-
Entity-bean data survives crashes.
-
An entity-bean represents non-persistent data.
-
It creates its own JAR file during deployment
-
You get authentication code without having to write any.
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.
-
When you want to be certain your application data persists between program invocations , even in the event of a crash
-
If you need to initiate a database transaction
-
To process transient data that can be re-created in the event of a crash.
-
to keep people who do not know how to program , from accidentally changing important logic code.
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.
-
To make the user interface more interesting.
-
To simplify application deployment.
-
To prevent malicious programs from gaining access to sensitive information on your database server.
-
To make the application much easier to update, maintain, and manage
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.