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 programming languages
  1. null

  2. Primary Key class

  3. Home Object

  4. Remote Object

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

In EJB Container-Managed Persistence (CMP), the ejbCreate() method must return null (or the primary key type, but per the EJB specification, the container manages primary key generation/mapping and CMP bean's ejbCreate() returns null so the container can initialize the primary key). The Home Object and Remote Object are client-side references, not returned by bean lifecycle methods.

Multiple choice technology programming languages
  1. The Session is not valid in the new Window

  2. The Session is valid in the new Window

  3. New session is created and that is valid.

  4. None of the above

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

When a new window is opened via JavaScript from a JSP page, session cookies are passed to the new window if it's within the same domain. This means the existing HTTP session remains valid and accessible in the new window. Option A is incorrect because sessions do persist across window opens. Option C is incorrect because a new session is not automatically created.

Multiple choice technology programming languages
  1. init(),service(),destroy()

  2. init(),destroy(),service(),

  3. init(),process(),destroy()

  4. init(),start(),destroy()

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

The servlet lifecycle follows init() for initialization, service() for processing requests, and destroy() for cleanup. The service() method is called repeatedly for each request until the servlet is destroyed.

Multiple choice technology programming languages
  1. Request Tracking

  2. Session tracking

  3. Process Tracking

  4. All the above

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

Session tracking is the mechanism servlets use to maintain state information about a series of requests from the same user across multiple HTTP connections, which are otherwise stateless.

Multiple choice technology programming languages
  1. JSP

  2. Controller

  3. Java classes

  4. XML

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

In J2EE MVC architecture, the Model represents business logic and data, typically implemented as Java classes (EJBs or POJOs). The Model handles data access, business rules, and application state, independent of the View or Controller.

Multiple choice technology programming languages
  1. JSP

  2. Controller

  3. Java classes

  4. XML

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

In J2EE MVC architecture, the View handles presentation and user interface, typically implemented as JSP (JavaServer Pages). JSPs combine HTML with Java code to dynamically generate web pages for display.

Multiple choice technology programming languages
  1. JSP files

  2. Java classes &gif and html file

  3. web component deployment descriptors

  4. All the above

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

A Java EE/Jakarta EE web module contains web components such as JSP files, static resources (HTML, GIF), Java classes (servlets/beans), and deployment descriptors (web.xml). Therefore, all the listed components are correct.

Multiple choice technology programming languages
  1. Applet

  2. Servlets

  3. Scriptlet

  4. Both b& c

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

Servlets are Java programs that extend server capabilities, handling client requests and generating dynamic responses. They run within a web container and provide request/response processing functionality for Java-enabled web servers, making them ideal modular extensions.

Multiple choice technology programming languages
  1. Displaying page data

  2. Connecting to database

  3. Routing Requests

  4. Performing front end validations

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

In MVC architecture implemented with servlets, the Servlet acts as the Controller, receiving requests and routing them to appropriate Model components and View pages. The Controller handles request processing flow, not direct database connections, page display, or frontend validations which are handled by other components.

Multiple choice technology programming languages
  1. Home Interface

  2. Remote Interface

  3. Bean Class

  4. All the above

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

Stateful session beans in EJB (Enterprise JavaBeans) architecture consist of three components: the Home Interface for lifecycle management, the Remote Interface for client access, and the Bean Class containing business logic.