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

Multiple choice technology web technology
  1. Action

  2. ActionForm

  3. ActionServlet

  4. None of the above

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

In Struts 1.x, ActionServlet serves as the Front Controller - it's the single entry point that receives all HTTP requests and delegates them to appropriate Action classes based on the struts-config.xml mapping. Action classes handle business logic, ActionForm holds form data, but ActionServlet is the centralized dispatcher implementing Front Controller.

Multiple choice technology programming languages
  1. in an online exchange between several open source developers

  2. over a long holiday weekend

  3. as a commercial package

  4. None of the above

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

Struts was originally developed by Craig McClanahan over a long holiday weekend in 2000 as a way to solve common web application development problems. It was not developed through an online exchange (A), not as a commercial package (C), and was donated to the Apache Software Foundation.

Multiple choice technology programming languages
  1. application

  2. resources

  3. ApplicationResources

  4. messages

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

The Application Resources file (which contains i18n messages) is configured via the servlet init-param named 'application' in web.xml. This parameter specifies the base name of the resource bundle. Options B, C, and D are incorrect parameter names for this configuration.

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.