Computer Knowledge
Java Enterprise and Web Technologies
2,183 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
-
Programming language.
-
Protocol.
-
Framework.
-
Web server.
C
Correct answer
Explanation
JSF (JavaServer Faces) is a Java web application framework for building component-based user interfaces. It simplifies web development by providing reusable UI components, managing state, and handling server-side logic. It is NOT a programming language (A), protocol (B), or web server (D) - it's a framework that runs on web servers.
-
Validator
-
Converters
-
Exception handler
-
Event listeners
C
Correct answer
Explanation
JSF provides validators for input validation, converters for type conversion between strings and objects, and event listeners for handling component events. Exception handling in JSF is typically managed through error-page configuration and custom exception factory rather than being a first-class framework-provided component.
-
Invoke application.
-
Apply request values
-
Update model values
-
Process validations
D
Correct answer
Explanation
JSF lifecycle phases in order are: Restore View, Apply Request Values, Process Validations, Update Model Values, Invoke Application, and Render Response. Process Validations is the 3rd phase where validators are executed on component values.
-
Event Handlers
-
Backing files
-
onRefresh method
-
listenTo portlet property
A
Correct answer
Explanation
Event Handlers are the preferred and recommended mechanism for implementing Inter-Portlet Communication (IPC) in modern portal frameworks. They provide a decoupled, event-driven architecture where portlets can publish and subscribe to events without direct dependencies. Backing files are for lifecycle management, onRefresh is a specific lifecycle method, and listenTo portlet property is an older, less flexible approach.
A
Correct answer
Explanation
Java ME (Micro Edition) supports SSL (Secure Sockets Layer) and HTTPS connections through the Generic Connection Framework (GCF). The framework provides security APIs including HTTPS and SSL/TLS protocols that allow secure network communication in mobile applications. SSL connections require proper security certificates and domain permissions configured in the JAD (Java Application Descriptor) file or device security settings.
-
Portability to all browsers needs to be addressed.
-
Your code may be exposed.
-
Reduction of page refreshes to enhance user experience.
-
Simulating client state on the browser and reducing the number of views.
A,B
Correct answer
Explanation
Moving all business logic to JavaScript creates two main problems: (1) Portability must be tested across all browsers since JavaScript implementations and DOM APIs vary, requiring extensive cross-browser testing and compatibility layers, and (2) Client-side code is inherently exposed to users who can view source, debug, and potentially exploit logic or extract proprietary algorithms. Options C and D are benefits (reduced refreshes, client state simulation), not drawbacks.
-
XML Schema document and details of Message Body is required to build a client.
-
WSDL document and Message headers must be supplied.
-
There is no need to supply WSDL or XML Schema document to the client.
-
Both WSDL document and XML Schema document must be supplied to the client.
C
Correct answer
Explanation
The JAX-WS Dispatch API allows dynamic service invocation without requiring compile-time WSDL or XML Schema. The Dispatch interface works directly with XML or SOAP messages, making it possible to invoke services when only the service endpoint and message structure are known at runtime. This is in contrast to static proxy generation which requires WSDL at development time.
-
Static and Dynamic only
-
static only
-
Synchronous and Asynchronous
-
synchronous only.
A,C
Correct answer
Explanation
JAX-WS supports both static proxy-based invocation (generating client stubs from WSDL at compile time) and dynamic invocation (using Dispatch API at runtime). It also supports both synchronous (blocking) and asynchronous (non-blocking with callbacks or polling) invocation patterns. These represent independent dimensions - static/dynamic refers to how the client is created, synchronous/asynchronous refers to how the call is made.
-
Logging protocol specific information
-
Adding security information to the message
-
Modifying protocol headers
-
Logic to service the request
D
Correct answer
Explanation
JAX-WS handlers are designed for cross-cutting concerns like logging protocol messages, adding security headers, or modifying protocol headers. They are NOT meant to contain business logic that services the request - that responsibility belongs to the service endpoint implementation class.
-
.NET application must be able to call your service.
-
Your client could be built in any language and run on any platform.
-
Guaranteed message delivery
-
Provide reusable & interoperable service across the industry.
C
Correct answer
Explanation
Java EE WebServices provide interoperability across platforms and languages (making .NET integration possible), support reusable services, and work with diverse clients. However, basic web services do NOT guarantee message delivery - that requires additional standards like WS-ReliableMessaging.
-
Code Break up
-
Code engineering
-
Code Tiering
-
Code Factoring
D
Correct answer
Explanation
Code Factoring is the technique of extracting common functionality into separate, reusable modules. Scott is asking developers to factor out business logic from servlets/JSP into EJBs, creating a cleaner separation between presentation logic and business logic.
-
Modularizing Code
-
Using well defined software design patterns
-
Using Servlets to manage distributed database access
-
Using JSP Scriptlets to locate enterprise beans
-
Using Data Access Objects when Session Beans or BMP Entity beans have to communicate to the database
C,D
Correct answer
Explanation
System extensibility is aided by modular code, design patterns, and DAO patterns. However, using Servlets to directly manage distributed database access tightly couples presentation to data access, and using JSP Scriptlets to locate EJBs embeds business logic in presentation - both harm extensibility.
-
Developing the code.
-
Confidentiality of code
-
It is very hard to deploy.
-
Javascript should never be used for Java EE applications. Java EE specification does not mention about javascript.
B
Correct answer
Explanation
When building UI controls with JavaScript, all the code runs on the client side in the browser. This means the entire source code is visible to anyone who uses View Source or browser developer tools - there's no way to hide or protect it. This exposes business logic, algorithms, and proprietary implementation details. Options A and C are incorrect - JavaScript development is standard and deployment is simply hosting files. Option D is false.
-
Implementing a solution with guaranteed message delivery.
-
When there is a need to exchange data between different applications on different platforms.
-
Application is a rich-GUI with minimal interactions with database
-
Applications need to exchange data in an an interoperable way.
B,D
Correct answer
Explanation
Web Services enable standardized communication between applications across different platforms and technologies. Option B correctly identifies the core use case: exchanging data between heterogeneous systems. Option D complements this with interoperability - a key goal of web services. Option A is incorrect because web services don't guarantee message delivery (that requires WS-ReliableMessaging). Option C describes a scenario where web services add unnecessary complexity.
-
JAX-WS talks about Web Services where as JAX-RPC is not related to Web Services.
-
Both use JAXB for data binding
-
JAX-WS uses JAXB for data binding.
-
JAX-RPC uses JAXB for data binding.
C
Correct answer
Explanation
JAX-WS (Java API for XML Web Services) is the modern standard that uses JAXB for XML data binding. JAX-RPC is the older, deprecated API. Option A is wrong because both are web service APIs. Option B claims both use JAXB, which is false - JAX-RPC does not. Option D incorrectly states JAX-RPC uses JAXB. Only JAX-WS uses JAXB.