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

Multiple choice technology programming languages
  1. Bypass calls to the ActionForm validate method

  2. Bypass validation of the Struts configuration file

  3. Generate an error message if an unknown message key is used

  4. None

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The 'validating' init-param of ActionServlet controls whether Struts validates its configuration file against the DTD. When set to true, it bypasses this validation (option B). It does NOT bypass ActionForm validation (A) - that's controlled differently. Option C is incorrect as message key errors are handled separately.

Multiple choice technology programming languages
  1. Use an asterisk for the path property

  2. Set the "default" property of the mapping to "true"

  3. Set the "unknown" property of the mapping to "true"

  4. Set the "missing" init-param of the ActionServlet to the mapping's path

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In Struts 1.x, to create a default/fallback ActionMapping that handles requests not matching any other mapping, you set the 'unknown' property to true on that mapping (option C). This is commonly used for 404-style handling. Option A is incorrect, B uses wrong property name, and D references a non-existent init-param.

Multiple choice technology programming languages
  1. Overriding the populate method of the ActionForm

  2. Overriding the processPopulate method of the Request Processor

  3. Overriding the populateBean method of the ActionMapping

  4. None

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Struts 1.1, the form population mechanism was moved from ActionForm to RequestProcessor. To customize how forms are populated, you override the processPopulate() method of RequestProcessor (option B). Option A is incorrect - ActionForm doesn't have a populate method, and C references a non-existent method.

Multiple choice technology programming languages
  1. a) Embedding of Java code in HTML pages

  2. b) Platform independence

  3. c) Creation of database-driven Web applications

  4. d) Server-side programming capabilities

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

JSP's key advantage over Servlets is the ability to embed Java code directly within HTML pages using special tags like <% %>. This makes JSP pages more natural for web designers and separates presentation from business logic more cleanly. While JSP does offer platform independence and can create database-driven applications, these are not unique advantages over Servlets. Server-side programming is common to both.

Multiple choice technology programming languages
  1. jspInit()

  2. jspService()

  3. jspDestroy()

  4. jspEnd()

Reveal answer Fill a bubble to check yourself
A,B,C Correct answer
Explanation

JSP has three lifecycle methods: jspInit() is called when the JSP is first initialized (similar to servlet init), jspService() is called for each request (the _jspService method handles the actual processing), and jspDestroy() is called when the JSP is being taken out of service. There is no jspEnd() method in the JSP lifecycle specification.

Multiple choice technology web technology
  1. Interface to making asynchronous calls AND sending data to the server

  2. Provides the debugging/logging console

  3. parse the html and look for elements with a dojoType attribute

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

xhrPost (note: typically lowercase in Dojo documentation) is a function for making asynchronous HTTP POST requests to a server, sending data as part of the request. It's used for AJAX-style form submissions and data transmission. Option A correctly describes this. Option B describes dojo/console, Option C describes the parser module.

Multiple choice technology architecture
  1. Surrogate

  2. Wrapper

  3. Token

  4. Proxy

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Adapter pattern is called Wrapper because it wraps an existing class with a new interface, allowing incompatible interfaces to work together. A Proxy controls access, Surrogate is another name for Proxy, and Token is unrelated to structural adaptation.

Multiple choice technology architecture
  1. Proxy

  2. Adapter

  3. Abstract Factory

  4. Bridge

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Bridge pattern is also known as Handle/Body because it separates abstraction (handle) from implementation (body), allowing them to vary independently. This decoupling prevents the permanent binding between abstraction and implementation that occurs with monolithic designs.

Multiple choice technology
  1. Application Support

  2. Program Change

  3. Emergency Change

  4. Fixed Variable

  5. Variable

  6. All of the Above

Reveal answer Fill a bubble to check yourself
A,B,C Correct answer
Explanation

The question asks to select SR types from the list. Application Support, Program Change, and Emergency Change are standard service request categories. Fixed Variable and Variable are not SR types. The 'All of the Above' option is logically incorrect because D and E should not be selected.

Multiple choice technology web technology
  1. Client side stubs automatically generated by a tool

  2. Dynamic Invocation Interface (DII)

  3. Dynamic proxies

  4. A, B, and C

  5. A client must invoke the service by looking up the Java interface in UDDI

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

JAX-RPC provides three invocation models for calling web services: static stubs generated from WSDL by tools, the Dynamic Invocation Interface (DII) for runtime calls without compile-time stubs, and dynamic proxies that combine type safety with runtime flexibility. These models give developers different trade-offs between convenience and flexibility when invoking services.

Multiple choice technology web technology
  1. New specification request in the community process

  2. A toolkit that allows developers to build, test and deploy Web Services

  3. Includes reference implementations for JavaServer Faces (JSF),JAXB,JAXP,JAXR,JAX-RPC,SAAJ and JSTL

  4. B and C

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The Java Web Services Developer Pack (WSDP) is a comprehensive toolkit for web service development. It provides reference implementations for key Java XML and web service technologies including JSF, JAXB, JAXP, JAXR, JAX-RPC, SAAJ, and JSTL, giving developers a complete environment to build, test, and deploy web services applications.

Multiple choice technology web technology
  1. To read and write to-from a UDDI registry using SOAP messages

  2. To read and write to-from an ebXML registry using SOAP messages

  3. A and B

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

JAX-R (Java API for XML Registries) provides a uniform, standard Java API for accessing different kinds of XML registries. It natively supports both UDDI (specification version 2.0) and ebXML (Registry services and Information Model) registries using XML/SOAP messaging.

Multiple choice technology web technology
  1. Can be used to generate server side and client side Java (Web Service) code from a WSDL

  2. Can be used to generate a WSDL from Java (Web Service) code

  3. Both A and B

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

JAX-RPC (Java API for XML-based RPC) supports bidirectional code generation. Developers can use tooling like wscompile to generate Java client/server stubs from an existing WSDL document (top-down), or generate a WSDL definition from Java source files (bottom-up).