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
-
a. TransactionalTestExecutionListener class
-
b. AbstractTransactionalSpringContextTests class
-
c. TestExecutionListener class
-
d. AbstractTestExecutionListener class
A
Correct answer
Explanation
TransactionalTestExecutionListener is a TestExecutionListener implementation in Spring's TestContext framework that provides transaction management for integration tests, including automatic transaction rollback after each test.
-
a.) 1, 3 & 4 only
-
b.) 1, 2 & 4 only
-
c.) 3, 4 & 5 only
-
d.) 1, 3 & 5 only
B
Correct answer
Explanation
ApplicationContext capabilities include: 1) loading file resources (via ResourceLoader), 2) internationalization via MessageSource interface, 3) event publishing to registered listeners, and 4) ORM integration. Option B (1, 2, 4) is correct - declarative transactions (5) require AbstractApplicationContext, not base ApplicationContext.
-
a) CORBA
-
b) Web Service
-
c) TEST
-
d) DCOMM
A,B
Correct answer
Explanation
SOA is an architectural pattern, not a specific technology. It can be implemented using various technologies including CORBA (Common Object Request Broker Architecture) and Web Services. Both provide mechanisms for services to communicate in a loosely coupled manner.
-
Resource manager server
-
Library server
-
lbosdata
-
All of above
B
Correct answer
Explanation
The library server is the central component in IBM Content Manager that handles authentication and generates security tokens used by the resource manager to validate client requests.
-
a) CORBA
-
b) Web Service
-
c) TEST
-
d) DCOMM
A,B
Correct answer
Explanation
SOA can be implemented using CORBA (Common Object Request Broker Architecture) for distributed objects and Web Services for standardized XML-based communication. TEST and DCOMM are not recognized SOA implementation technologies.
-
j_login
-
j_get_user
-
j_login_check
-
j_get_security
-
j_security_check
E
Correct answer
Explanation
In Java EE form-based authentication, the login form must POST to j_security_check. This is a built-in servlet container endpoint that receives j_username and j_username parameters, authenticates the user against the realm, and redirects to the protected resource or error page. The other options (j_login, j_get_user, j_login_check, j_get_security) are not standard container-managed authentication endpoints.
-
<realm-name>
-
<auth-method>
-
<security-role>
-
<transport-guarantee>
-
<web-resource-collection>
E
Correct answer
Explanation
The element is required in a because it defines which resources (URL patterns) are being protected. The other elements ( goes in , goes in , is a separate top-level element, goes in ) serve different purposes or are in different sections of the deployment descriptor.
-
An error occurs during page translation
-
Translation is successful, but nothing is included in the response.
-
Both "10 x 5 = 50" and "2 * 3 = 6" are included in the JSP response
-
The text "10 x 5 = 50" is included in the JSP response, but "2 * 3 = 6" is NOT
-
The text "2 * 3 = 6" is included in the JSP response, but "10 x 5 = 50" is NOT
C
Correct answer
Explanation
When is false, both scripting expressions (<%= ... %>) and EL expressions (${ ... }) are allowed. Therefore, the JSP will successfully translate and execute both '10 x 5 = 50' (using EL) and '2 * 3 = 6' (using scripting expression). Setting it to true would disable scripting elements but not EL.
-
in an online exchange between several open source developers
-
over a long holiday weekend
-
as a commercial package
-
none
B
Correct answer
Explanation
According to Struts history, the framework was first developed over a long holiday weekend by Craig R. McClanahan. This is the well-known origin story of the Apache Struts framework.
-
application
-
resources
-
ApplicationResources
-
messages
A
Correct answer
Explanation
The Application Resources file name is set by the servlet init-param named "application" in web.xml. This parameter specifies the base name of the resource bundle properties file.
-
Bypass calls to the ActionForm validate method
-
Bypass validation of the Struts configuration file
-
Generate an error message if an unknown message key is used
-
none
B
Correct answer
Explanation
The validating init-param of ActionServlet, when set to false, bypasses validation of the Struts configuration file (struts-config.xml). It does not affect ActionForm validation.
-
Use an asterisk for the path property
-
Set the "default" property of the mapping to "true"
-
Set the "unknown" property of the mapping to "true"
-
Set the "missing" init-param of the ActionServlet to the mapping's path
C
Correct answer
Explanation
To specify a default ActionMapping for unmatched requests, you set the unknown property to true. This creates a catch-all mapping that handles any request path not explicitly defined.
-
Overriding the populate method of the ActionForm
-
Overriding the processPopulate method of the Request Processor
-
Overriding the populateBean method of the ActionMapping
-
None
B
Correct answer
Explanation
In Struts 1.1, the RequestProcessor class contains the processPopulate method that handles form population. Overriding this method allows customization of how request parameters populate ActionForm beans. ActionForm does not have a populate method, and ActionMapping is not involved in population.
-
ASP.NET applications run without a Web Server
-
ASP+ and ASP.NET refer to the same thing
-
ASP.NET is a major upgrade over ASP
-
None of the Above
-
Setter Injection
-
Method Injection
-
Constructor injection
-
Interface Injection
A,C
Correct answer
Explanation
Spring primarily supports Setter Injection and Constructor Injection as its main dependency injection mechanisms.