Computer Knowledge

Java Enterprise and Web Technologies

2,183 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 architecture
  1. Web Services

  2. Struts

  3. JDBC

  4. EJB

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

Struts is a MVC framework specifically designed for building presentation layers in J2EE applications. It provides structured web application development with clear separation between Model, View, and Controller components. Web Services are for service-oriented architecture, JDBC is for database connectivity, and EJB is for business logic and enterprise services.

Multiple choice technology architecture
  1. Hibernate

  2. Spring Framework

  3. ILOG Jrules.

  4. Savvion.

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

ILOG JRules (now IBM Operational Decision Manager) is a Business Rule Management System (BRMS) that enables both business users and developers to collaboratively manage business rules. It provides tools for rule authoring, testing, and deployment in a centralized repository. Hibernate is an ORM framework, Spring is a comprehensive framework, and Savvion is a Business Process Management Suite.

Multiple choice technology architecture
  1. Top Down Approach

  2. Bottom Up Approach

  3. Top Left Approach

  4. Bottom Right Approach

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

The Bottom Up Approach in web services development starts with writing the Java class first, then generating the WSDL (Web Services Description Language) from it. This contrasts with the Top Down Approach where you start with a WSDL contract and generate the Java class from it.

Multiple choice technology architecture
  1. Find

  2. Bind

  3. Publish

  4. EndPoint.

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

In the SOA publish-find-bind model, the Publish interaction occurs between the Service Provider and the Registry. The provider publishes information about its service to the registry so consumers can later find it. Find is between Consumer and Registry, Bind is between Consumer and Provider.

Multiple choice technology architecture
  1. WSDL

  2. UDDI

  3. SAAJ

  4. JAXR

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

UDDI (Universal Description, Discovery, and Integration) defines a standard set of operations for storing and looking up information about web services in a registry. It provides publish, find, and binding operations. WSDL describes individual services, SAAJ handles SOAP messaging, and JAXR accesses registries.

Multiple choice technology architecture
  1. JAX-RPC

  2. SAAJ

  3. JAXR

  4. JNDI

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

JNDI (Java Naming and Directory Interface) is not a J2EE web services API. It is a general-purpose API for accessing naming and directory services (like LDAP). JAX-RPC (for RPC-style services), SAAJ (for SOAP with attachments), and JAXR (for XML registries) are all part of the J2EE web services API suite.

Multiple choice technology architecture
  1. Lib Directory of Java Home.

  2. Lib Directory of Application/Web Server.

  3. Source Directory of the Hibernate Project.

  4. None of the above.

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

The hibernate.cfg.xml configuration file must be on the application classpath to be automatically detected by Hibernate at startup. Placing it in the source directory ensures it gets copied to the classpath root during compilation. Lib directories are for JAR dependencies, not configuration files.

Multiple choice technology architecture
  1. SessionFactory

  2. Session

  3. Transaction

  4. None of the Above.

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

The Hibernate Session represents a single-threaded unit of work and is the primary interface for CRUD operations. Sessions are lightweight and not thread-safe - each thread should obtain its own session. SessionFactory is thread-safe and creates sessions, while Transaction represents a transaction within a session.

Multiple choice technology architecture
  1. Reloads the Whole Page and take less time.

  2. Reloads only the necessary changes on the Current Page and takes less time.

  3. Both

  4. None of the above.

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

AJAX (Asynchronous JavaScript and XML) allows web pages to update specific portions asynchronously without reloading the entire page. This selective update reduces bandwidth usage and improves response time. Option B correctly describes this core AJAX advantage.

Multiple choice technology architecture
  1. Data Access Object.

  2. MVC

  3. Business Delegate

  4. Service Locator.

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

Data Access Object (DAO) Pattern abstracts and encapsulates access to data sources, providing a uniform interface to different backends like legacy systems, B2B interfaces, or LDAP. It hides implementation details of data source interactions. MVC separates concerns, Business Delegate reduces coupling between tiers, and Service Locator looks up resources - none abstract heterogeneous data access like DAO.

Multiple choice technology architecture
  1. JSP, Servlets.

  2. JSP, Servlets, EJBs

  3. Applets, EJBs

  4. No need to change it.

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

For a web-based price comparison site, JSP (presentation) and Servlets (controller logic) are sufficient. EJBs add unnecessary complexity for what appears to be a simple web application without distributed transaction or complex business logic requirements. Applets are deprecated client-side technology.

Multiple choice technology architecture
  1. The EJB tier hosts the application-specific business objects.

  2. The EJB tier does not host system-level services (such as transaction management, concurrency control and security); they are hosted on the EIS tier.

  3. The EJB tier is a link between the web tier and the EIS integration tier.

  4. The EJB tier hosts the entity beans and session beans, data access objects and value objects and perhaps master-detail modeling using enterprise beans.

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

The statement 'EJB tier does not host system-level services... they are hosted on the EIS tier' is NOT true. The EJB container (within EJB tier) actually PROVIDES system-level services like transaction management, security, concurrency control, pooling, and lifecycle management. EIS tier handles enterprise information systems like databases and legacy systems.

Multiple choice technology architecture
  1. getIdentity()

  2. getCallerPrincipal()

  3. getCallerIdentity()

  4. getUserId()

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

EJBContext.getCallerPrincipal() is the standard EJB API method to retrieve the caller's identity (as a java.security.Principal object) within enterprise bean code. This works in both session and entity beans. getIdentity(), getCallerIdentity(), and getUserId() are not standard EJBContext methods.

Multiple choice technology architecture
  1. Containers run within servers.

  2. Servers run within containers.

  3. Only one server can run in a container.

  4. Only one container can run in a server.

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

EJB Containers run WITHIN EJB Servers. The server provides the runtime environment (JVM, networking, resources), while the container manages EJB lifecycle, transactions, security, and other services. Multiple containers can run within a single server. The server is the broader hosting environment.