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
-
Add custom tags to each page
-
Add entries to cache configuration file.
-
Install the Cache Monitor.
-
Pre-compile the JSPs
B
Correct answer
Explanation
Before WebSphere dynacache can cache custom store pages, you must configure the cache by adding entries to the cachespec.xml file. This configuration file defines which pages to cache, cacheability rules, expiration policies, and other cache behavior parameters.
-
global-forwards
-
action-mappings
-
message-resources
-
global-exceptions
C
Correct answer
Explanation
The Struts framework uses message-resources (MessageResources properties files) to define error message text that the framework uses for exception handling. These resource bundles contain key-value pairs where the framework looks up messages by key to display localized error text to users, which is the standard approach for externalizing message text in Struts applications.
-
Set soapAction field to the operation name.
-
Disable data binding and use SOAPElement.
-
Do not backup and overwrite skeleton bean.
-
Generate Java from WSDL using the no wrapped style.
B
Correct answer
Explanation
In Rational Application Developer for WebSphere Commerce web services development, disabling data binding and using SOAPElement is required for handling complex SOAP messages where automatic Java object mapping would fail. This preference allows direct manipulation of the raw SOAP XML structure.
-
Name, target, subdeployment, descriptor-file-name
-
Domain, jms-server, connection factory, destination
-
Config.xml, jms-module, subdeployment, descriptor-file-name
-
Name, jms-module, subdeployment, descriptor-file-name
A
Correct answer
Explanation
In WebLogic 9.2, JMS system-resource modules in config.xml require four basic components: a name for identification, target(s) to specify which servers/clusters, subdeployment for organizing resources, and descriptor-file-name pointing to the JMS configuration XML. Option B incorrectly lists runtime components rather than config elements. Option C incorrectly includes config.xml itself as a component.
-
Graphical mode, console mode and secure mode
-
Graphical mode, console mode and silent mode
-
Script mode, console mode and silent mode
-
Script mode, console mode and secure mode
B
Correct answer
Explanation
WebLogic Server supports three installation modes: Graphical mode (GUI installer), Console mode (command-line interactive), and Silent mode (unattended using XML files). There is no 'secure mode' (A, D) or distinct 'script mode' (C, D) - the silent mode using scripts/XML is the correct term.
-
Node Manager process is associated with the specific WebLogic domain
-
Node Manager cannot start the admin server.
-
Node Manager on one machine can start multiple Managed Servers on different machines.
-
Node Manager on one machine can start multiple Managed Servers on the same machine.
D
Correct answer
Explanation
The Java-based Node Manager runs per machine and can control multiple Managed Servers on that same machine (D). It is NOT domain-specific (A is false). It CAN start the Admin server (B is false). It cannot start servers on different machines - each machine needs its own Node Manager instance (C is false).
-
An insecure J2EE web application
-
A framework for analyzing applications that communicate using the HTTP and HTTPS, most common usage is an intercepting proxy
-
Static Source Code Analyser
-
Penetration Testing Tool
B
Correct answer
Explanation
OWASP WebScarab is a framework for analyzing applications using HTTP/HTTPS protocols, primarily used as an intercepting proxy to inspect and modify traffic between clients and servers. It is not an insecure application, static analyzer, or dedicated penetration testing tool.
-
An insecure J2EE web application
-
A framework for analyzing applications that communicate using the HTTP and HTTPS, most common usage is an intercepting proxy
-
Static Source Code Analyser
-
Penetration Testing Tool
B
Correct answer
Explanation
WebScarab is a framework developed by OWASP for analyzing applications that communicate via HTTP and HTTPS. Its most common usage is as an intercepting proxy, allowing security professionals to inspect and modify web traffic between browsers and servers for testing purposes.
-
SQL Injection
-
Denial of Service
-
XML Injection
-
All of the above
D
Correct answer
Explanation
Web services face the same attack vectors as traditional web applications. SQL injection targets the database layer, DoS attacks overwhelm service availability, and XML injection exploits XML parsing vulnerabilities. All three are well-documented web service security threats.
-
Page Scope
-
Session Scope
-
Request Scope
-
Application Scope
B
Correct answer
Explanation
In web applications, Session Scope stores data specific to a user session throughout their interaction with the application. Page Scope is per individual page, Request Scope lasts only for a single HTTP request, and Application Scope is global across all users and sessions. Session scope maintains user-specific state (like cart contents or login status) across multiple requests.
-
The length of the User's Session
-
The length of a single HTTP response
-
The length of a single HTTP request
-
Until the server is rebooted
C
Correct answer
Explanation
Request scope in web applications refers to data and context that exists only for the duration of processing a single HTTP request. Once the response is sent, the request scope data is destroyed. Session scope persists across multiple requests from the same user, and application scope persists until server restart.
-
Technology
-
Frameworks
-
Java Development Tool Kit
-
Language
B
Correct answer
Explanation
Struts is a web application framework for Java that follows the Model-View-Controller (MVC) architecture pattern. It provides structure for building web applications, handling requests, managing views, and separating business logic from presentation. A framework provides reusable components and conventions, unlike a language, technology, or JDK.
A
Correct answer
Explanation
Spring MVC is fundamentally designed around the request-response lifecycle. Each HTTP request is handled by a dispatcher servlet, routed to controllers, and generates a response - making it a request-based framework.
-
Struts 1.3.8, Struts 1.2.8
-
Struts 1.2.7,Struts 1.0.2
-
Struts 3.0.11.1, Struts 1.0.11
-
Struts 2.0.11.1, Struts 2.0.6
C
Correct answer
Explanation
Struts framework has major versions 1.x and 2.x. Option C lists "Struts 3.0.11.1" which never existed - there was no Struts 3.x release (Apache Struts went from 2.x directly to Struts 2.5.x and beyond). The 3.0 version number is fictitious.
-
Both synchronous and asynchronous
-
asynchronous
-
synchronous
-
none
A
Correct answer
Explanation
JMS (Java Message Service) supports both synchronous (synchronous receive blocks until message arrives) and asynchronous (message listener receives callbacks) messaging modes, giving developers flexibility in application design.