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
Correct answer
Explanation
SOAP (Simple Object Access Protocol) is the complete web service framework that defines the XML message format, HTTP binding conventions, and RPC representation standards. XML (B) is just the data encoding format, UDDI (C) is for service discovery registry, and WSDL (D) describes the service interface but not the message protocol itself.
-
Accessing a UDDI description from the WSDL registry and binds to the service using SOAP
-
Accessing a SOAP description from the UDDI registry and binds to the service using UDDI
-
Accessing a SOAP description from the WSDL registry and binds to the service using UDDI
-
Accessing a WSDL description from the UDDI registry and binds to the service using SOAP
D
Correct answer
Explanation
Web service consumption follows the pattern: discover the service in UDDI (registry), retrieve its WSDL description (interface definition), then bind using SOAP (message protocol). Option D correctly sequences these steps. Options A-C incorrectly pair the protocols with their purposes or reverse the registry relationship.
-
Compilers for different programming languages and target machines
-
Decision support systems
-
Web applications
-
Middleware
C
Correct answer
Explanation
Option C is correct because Apache Struts is a web application framework for Java - it specifically addresses the domain of building web-based applications and follows the Model-View-Controller (MVC) pattern. Options A (compilers), B (decision support systems), and D (middleware) are different problem domains that Struts is not designed to solve. Struts provides utilities for handling HTTP requests, managing form data, and organizing web application logic.
-
cookie
-
sessionStorage
-
dataStorage
-
localStorage
B,D
Correct answer
Explanation
HTML5 introduced Web Storage API with sessionStorage (data cleared when session ends) and localStorage (persists until deleted). Cookies are an older mechanism with size limitations, and dataStorage is not a valid HTML5 storage object.
-
SerivceTypeAttribute
-
ServiceAttribute
-
ServiceBehaviourAttribute
-
ServiceTypeBehaviour
C
Correct answer
Explanation
ServiceBehaviorAttribute in WCF controls service instance lifetime through the InstanceContextMode property. This property determines whether a single instance serves all clients (Single), each client gets its own instance (PerSession), or each call gets a new instance (PerCall).
-
Message
-
Stream,IXMLSerializable
-
Message,Stream
-
Message,Stream or an IXMLSerializable
D
Correct answer
Explanation
In WCF, only Message, Stream, and types implementing IXMLSerializable can be used as parameters for streaming operations. These types support streaming because they can be read and written sequentially without buffering the entire message.
-
Starting the car
-
Authentication
-
Audit trails
-
Adjusting room temperature
A,B,C,D
Correct answer
Explanation
Java Ring is a smart card technology that can be programmed for various applications. All listed uses are theoretically possible implementations - authentication (most common), audit trails (security logging), starting cars (ignition systems), and adjusting room temperature (smart home integration). The question asks what it CAN be used for, not just typical uses.
-
Action Servlet
-
Action Controller
-
JSP
-
All of the above
B
Correct answer
Explanation
In MVC architecture, the Action Controller is responsible for handling user requests and updating the model state. It processes input, executes business logic, and modifies model data as needed. The Action Servlet handles request routing, JSP is for presentation, and neither directly performs model updates. The controller layer is specifically designed for this coordination role.
-
Request
-
Cookie
-
Application context
-
Global Session
D
Correct answer
Explanation
Global Session provides application-wide data persistence across all pages and requests for a specific user. Request scope only lasts for a single HTTP request, Cookie has size limitations and security concerns, and Application context is shared across all users rather than being session-specific.
-
Action Controller
-
Action Servlet
-
JSP
-
PageHandler
D
Correct answer
Explanation
The PageHandler component is responsible for validating user input in the PS Framework architecture. Action Controller manages flow control, Action Servlet handles request dispatching, and JSP is for presentation - none of these are primarily responsible for input validation.
-
Action Servlet
-
Action Controller
-
JSP
-
PS.xml
B
Correct answer
Explanation
The Action Controller is where business services are invoked in the PS Framework's MVC architecture. Action Servlet handles request routing, JSP manages presentation, and PS.xml contains configuration - only the Controller orchestrates business logic.
-
Web.xml
-
AC.xml
-
Manifest
-
None of the above
C
Correct answer
Explanation
The Manifest file is where classpath entries and external JAR dependencies are declared for Java applications. Web.xml configures servlet mappings, AC.xml is not a standard configuration file, making Manifest the correct location for dependency entries.
-
Web.xml
-
Metadata.xml
-
InitializationWebapp.properties
-
Config.xml
C
Correct answer
Explanation
InitializationWebapp.properties is where the PS Framework expects entries for ps.xml location so that the Action Servlet can locate and load the configuration during application startup. Web.xml is for servlet configuration, and the other files are not standard initialization mechanisms.
-
getApplicationID()
-
getSecurityLevel()
-
getSessionBehaviour()
-
None of the above
A
Correct answer
Explanation
getApplicationID() is the minimum required method override for ActionServlet in the PS Framework, as it uniquely identifies the application within the system. getSecurityLevel() and getSessionBehaviour() are optional overrides for specific customization needs.
-
Client Modules
-
Web App Modules
-
EJB Modules
-
All the above
D
Correct answer
Explanation
EAR (Enterprise Archive) files in Java EE can contain multiple module types including web application modules (WAR files), EJB modules (JAR files with enterprise beans), and client application JARs. This modular structure allows packaging complete enterprise applications with all their components.