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 programming languages
  1. session and request

  2. page, request and session

  3. page, request, session and application

  4. request, session and application

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

Struts provides four scope options: page (current page only), request (current HTTP request), session (user session across requests), and application (global to the web application). These scopes control data visibility and lifecycle throughout the application.

Multiple choice technology programming languages
  1. Programming language

  2. Software architecture

  3. UI concept

  4. Networking Standard

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

Service-Oriented Architecture is a software architecture style where application components provide services to other components through network protocols. It emphasizes loose coupling, reusability, service abstraction, and is often implemented using web services.

Multiple choice technology programming languages
  1. Abstract factory

  2. Factory Method

  3. Prototype

  4. Singleton

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

Singleton ensures exactly one instance exists per database, with global access. For connection pools, you want one pool object managing connections for each database. Factory patterns create new instances, and Prototype copies existing ones - neither controls instance count like Singleton does.

Multiple choice technology programming languages
  1. Publisher pattern

  2. Flyweight pattern

  3. Observer pattern

  4. Chain of Responsibility pattern

  5. Subscribe pattern

  6. Proxy pattern.

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

Observer defines one-to-many dependency: when subject changes, all dependents are notified automatically. This IS publish-subscribe: publishers (subjects) broadcast to subscribers (observers) without knowing who they are. The pattern decouples event generation from event handling.

Multiple choice technology programming languages
  1. It is used primary by Servlets to locate other services such as JMS. A good example of this pattern would be a web based login facility. If a client enters an incorrect password their need to be redirected to a different but their session needs to be main

  2. Multiple clients can reuse the same Service Locator pattern.

  3. The Service Locator pattern can improve performance by introducing a caching facility.

  4. There is a slight loss of performance when using the Service Locator pattern but this is out weighed by the improved maintainability of the code.

  5. None of the definitions of the Service Locator pattern are accurate.

  6. The Service Locator pattern is used to hide the complexities of initial object creation, EJB lookups and object re-creation.

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

The Service Locator pattern centralizes service lookup logic and abstracts the complexity of JNDI/EJB lookups. Multiple clients can share a single Service Locator instance, which improves performance by caching frequently used service references. This pattern hides low-level lookup details from client code, making it easier to maintain and modify. Options B, C, and F correctly identify reusability, performance through caching, and complexity hiding as key benefits.

Multiple choice technology programming languages
  1. Iterator

  2. Mediator

  3. Interpreter

  4. State

  5. Singleton

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

The ServletContext object acts as a Singleton - there is exactly one ServletContext instance per web application that all servlets share. This shared context holds application-wide resources and configuration, accessible to all servlets within that application. While Mediator, State, and Interpreter serve different purposes, the key here is the single shared container instance. Singleton ensures one instance exists and provides global access, which matches how ServletContext functions.

Multiple choice technology web technology
  1. To clear the namespace prior to installing or redeploying an application

  2. When the application server will not start because the JNDI namespace tables have become corrupted

  3. Before regenerating the plug-in for the Web server

  4. When applications are experiencing a problem accessing a specific WebSphere data source

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

The dumpNameSpace utility is primarily used for diagnosing JNDI and namespace-related issues, including applications having trouble accessing specific WebSphere resources like data sources that are registered in the JNDI namespace.

Multiple choice technology web technology
  1. Class loader configuration

  2. Virtual host configuration

  3. HTTPS port configuration

  4. Admin console configuration

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

Virtual host configuration isolates web modules by controlling which applications/resources can be accessed through specific virtual hosts. This provides security and resource separation between different web modules.

Multiple choice technology mainframe
  1. Bring in another System z machine

  2. Implement a firewall on the mainframe and use WebSphere to enable the web site on a Linux server.

  3. Implement a firewall on a new, small Unix server and use WebSphere to enable the web site on the mainframe

  4. Implement a firewall on a new Windows XP server and use WebSphere to enable the web site on a new Windows XP server.

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

For security and architectural design, implementing a firewall on a dedicated Unix/Linux edge server while hosting the core WebSphere application server directly on the z/OS mainframe allows secure external web access while keeping the application tier tightly coupled to mainframe backend data.

Multiple choice technology programming languages
  1. GET

  2. TRACE

  3. POST

  4. HEAD

  5. OPTIONS

  6. SERVICE

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

An idempotent method can be called multiple times yielding the same side effects. GET, HEAD, OPTIONS, and TRACE are safe and idempotent. POST is typically not idempotent because multiple identical requests can result in duplicate resource creation or state updates.

Multiple choice technology programming languages
  1. 2

  2. 3

  3. 4

  4. 5

  5. 6

  6. 7

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

The select element has 5 unselected options. With multiple attribute enabled, all 5 could be selected in addition to the 2 pre-selected ones (Java, C), giving 7 total. The submit button is a different parameter and doesn't affect the Languages count.

Multiple choice technology programming languages
  1. /WEB-INF

  2. /appserverInstallDirectory/webapps/webappName/WEB-INF/xml

  3. /appserverInstallDirectory/webapps/webappName/WEB-INF

  4. /appserverInstallDirectory/webapps/webappName/WEB-INF/classes

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

According to the servlet specification, web.xml must be in the WEB-INF directory of the web application. This is specified either relative to the web app root (/WEB-INF) or as an absolute path within the application server's webapps directory structure.

Multiple choice technology programming languages
  1. A runtime error

  2. "Initialization Parameter is: null" written to the console

  3. "Initialization Parameter is: question14" returned to the requester

  4. "Initialization Parameter is: null" returned to the requester

  5. "Initialization Parameter is: question14" written to the console

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

In the deployment descriptor, initParm is configured as a servlet-specific initialization parameter under `. In the servlet code,sc.getInitParameteris called on theServletContext`, which retrieves context-wide parameters rather than servlet-specific ones. Thus, it returns null, making the output 'Initialization Parameter is: null'.