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 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.

Multiple choice technology packaged enterprise solutions
  1. Is a standalone Web Application that can be called using a URL

  2. Can be called as an iView in the SAP Portal

  3. Allows you to save the data view after ad-hoc analysis.

  4. All of the above is correct

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

BEx Web Analyzer is a flexible SAP Business Explorer tool. It can be accessed as a standalone web application via URL, integrated as an iView within SAP Portal, and allows saving data views after ad-hoc analysis. Therefore all three statements A, B, and C are correct, making D the right choice.

Multiple choice technology web technology
  1. The response from ASP.NET web page is modified to suit a mobile device.

  2. It automatically caches the web pages specific for mobile devices to improve performance.

  3. It comes with a set of scripts to check mobile readiness of web pages.

  4. It gives more accurate / enhanced information in Request.Browser object than is available by default in ASP.NET 4.0.

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

The 51Degrees.Mobi library, when used with the WURFL device database, populates the Request.Browser object with far more detailed and accurate device capability information than ASP.NET 4.0 provides by default. It doesn't modify responses, cache pages, or provide readiness checking scripts - its advantage is enhanced device detection.

Multiple choice technology web technology
  1. Session_Start method in code behind file of web page

  2. Application_Start method in Global.asax file

  3. Page_Init handler of web page

  4. Session_Start method in Global.asax file

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

The Session_Start event in Global.asax fires when a new user session begins, making it the ideal place to redirect mobile users to a mobile-specific page at the start of their browser session. The Session_Start in code-behind wouldn't fire at session start, Application_Start is for app-level initialization, and Page_Init is for individual page initialization.