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
-
SessionFactory.getSession();
-
SessionFactory.openSession();
-
SessionFactory.get();
-
(session)SessionFactory.getObject();
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.
-
<hibernate-mapping>
-
<session-mapping>
-
<sessionfactory-mapping>
-
none of the above
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.
-
An open source, interactive Web content generation system similar to Adobe Flash
-
A server-side programming language that enables rich Internet applications
-
A programming technique that allows portions of Web pages to be updated without a full refresh
-
The next generation of the JavaScript programming language
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.
-
C++ only
-
Java only
-
Both C++ and Java
-
Neither C++ nor Java
C
Correct answer
Explanation
The Enterprise Information Portal (EIP) / Information Integrator for Content (Ii4C) toolkit provides software development connectors in both C++ and Java languages.
B
Correct answer
Explanation
JAXB requires developers to understand XML structure and schemas to properly map XML elements to Java classes. It simplifies XML processing through marshalling and unmarshalling but doesn't eliminate the need for XML knowledge.
B
Correct answer
Explanation
JavaBeans are simple reusable components with properties and methods. They are not J2EE components like EJBs, servlets, or JSPs which are part of the enterprise framework.
A
Correct answer
Explanation
The OpenText Documentum Content Server is primarily written in C++ (and C) to ensure high performance, low-level system integration, and efficient memory management.
-
Protocol for accessing a Web Service
-
SOAP is designed to communicate via Internet
-
SOAP allows you to get around firewalls
-
1 & 3
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.
-
GET
-
TRACE
-
POST
-
HEAD
-
OPTIONS
-
SERVICE
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).
-
If the servlet has a doGet() method, it executes that instead.
-
404 response code: SC_NOT_FOUND.
-
405 response code: SC_METHOD_NOT_ALLOWED.
-
500 response code: SC_INTERNAL_SERVER_ERROR.
-
501 response code: SC_NOT_IMPLEMENTED.
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.
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.
-
During web application startup
-
If there are insufficient instances of the servlet to service incoming requests
-
On a client first requesting the servlet
-
At the same time as a different servlet is instantiated, when that different servlet makes use of the servlet in question
-
After the time specified on an UnavailableException has expired
-
At some arbitrary point in the web application or application server lifetime
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.
-
As transient work area for storing temporary data such as compiled JSPs.
-
It must contain the web.xml file
-
It contains deployment specific details
-
All of the above
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.