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 web technology
  1. SessionFactory.getSession();

  2. SessionFactory.openSession();

  3. SessionFactory.get();

  4. (session)SessionFactory.getObject();

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

To obtain a Session object from SessionFactory, you call the openSession() method. The Session interface is the primary interface for Hibernate persistence operations, used for CRUD operations and queries.

Multiple choice technology web technology
  1. <hibernate-mapping>

  2. <session-mapping>

  3. <sessionfactory-mapping>

  4. none of the above

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

The root-level element in a Hibernate mapping file is . This element serves as the container for all class and collection mappings. It can include attributes like package, schema, and catalog to apply defaults to nested mappings.

Multiple choice technology web technology
  1. An open source, interactive Web content generation system similar to Adobe Flash

  2. A server-side programming language that enables rich Internet applications

  3. A programming technique that allows portions of Web pages to be updated without a full refresh

  4. The next generation of the JavaScript programming language

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

AJAX (Asynchronous JavaScript and XML) is a technique that allows web applications to send and retrieve data from a server asynchronously, without interfering with the display and behavior of the existing page. This enables dynamic updates to portions of a webpage without requiring a full page refresh.

Multiple choice technology web technology
  1. Protocol for accessing a Web Service

  2. SOAP is designed to communicate via Internet

  3. SOAP allows you to get around firewalls

  4. 1 & 3

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

SOAP (Simple Object Access Protocol) is indeed a protocol for accessing web services (A), designed for internet communication (B), and uses HTTP which allows it to traverse firewalls (C). All three statements correctly describe SOAP's purpose and characteristics.

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

HTTP methods are idempotent if multiple identical requests have the same effect as a single request. GET, HEAD, OPTIONS, TRACE, and PUT are idempotent. POST is NOT idempotent - submitting the same POST request multiple times can create multiple resources or change state multiple times (e.g., placing an order twice).

Multiple choice technology programming languages
  1. If the servlet has a doGet() method, it executes that instead.

  2. 404 response code: SC_NOT_FOUND.

  3. 405 response code: SC_METHOD_NOT_ALLOWED.

  4. 500 response code: SC_INTERNAL_SERVER_ERROR.

  5. 501 response code: SC_NOT_IMPLEMENTED.

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

If a servlet receives an HTTP POST request but does not implement the doPost() method, the default implementation in HttpServlet returns an HTTP 405 (Method Not Allowed) response code, indicating that the requested HTTP method is not supported by this resource.

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

This HTML form has a multi-select dropdown with 6 options, 2 of which (Java and C) are pre-selected with the 'selected' attribute. When the user clicks submit without changing selections, the servlet receives: Languages=JAVA, Languages=C, and button= - totaling 3 parameter name-value pairs. However, with 'multiple' select, each selected value creates a separate parameter with the same name. If all 6 were selected, it would be 6 Languages parameters plus 1 button parameter = 7 total.

Multiple choice technology programming languages
  1. During web application startup

  2. If there are insufficient instances of the servlet to service incoming requests

  3. On a client first requesting the servlet

  4. At the same time as a different servlet is instantiated, when that different servlet makes use of the servlet in question

  5. After the time specified on an UnavailableException has expired

  6. At some arbitrary point in the web application or application server lifetime

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

Servlets are instantiated during web application startup when configured with load-on-startup (A). They are also created on the first client request to that servlet if not already initialized (lazy initialization). After an UnavailableException expires, the servlet becomes available and may be instantiated (E). Option F, while vaguely worded, reflects that containers manage servlet lifecycle dynamically - they can create instances based on demand, configuration, or internal optimization at various points in the application lifetime. Option B is incorrect because containers manage instance pooling automatically, not by creating new ones on demand. Option D is incorrect because servlet instantiation is not triggered by other servlets being instantiated.

Multiple choice technology platforms and products
  1. As transient work area for storing temporary data such as compiled JSPs.

  2. It must contain the web.xml file

  3. It contains deployment specific details

  4. All of the above

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

In MyEclipse, the .myeclipse folder in a web application serves as a transient work area for storing temporary files like compiled JSPs, class files, and other build artifacts. It is not required to contain web.xml (that belongs in WEB-INF) and does not store deployment-specific details.