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 web technology
  1. WS-Routing

  2. WS-Referral

  3. Not possible in SOAP.

  4. a & b

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

WS-Routing is a stateless protocol that extends SOAP by defining means to specify an ordered route for message transmission. It introduces SOAP headers that define the path a message should take through intermediaries. This enables explicit routing control while maintaining statelessness. Option A is correct.

Multiple choice technology web technology
  1. “from”

  2. “to”

  3. “fwd”

  4. “rev”

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

WS-Routing defines a 'path' SOAP header containing several elements including 'from', 'to', 'fwd', and 'rev'. The 'from' element specifically identifies the message originator (the sender). This is part of the routing information that helps track the message's journey through the network. Option A is correct.

Multiple choice technology web technology
  1. “from”

  2. “to”

  3. “fwd”

  4. “rev”

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

In WS-Routing, the "to" element within the SOAP "path" header specifies the ultimate receiver of the message. The "from" element identifies the original sender, "fwd" contains the forward path through intermediaries, and "rev" contains the reverse path for responses.

Multiple choice technology web technology
  1. True

  2. False

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

SOAP is fundamentally about document-based XML message exchange, not RPC-style object access. While SOAP can be used in an RPC-style (where Body contains method call parameters), the SOAP specification itself does not define object models, method invocation, or remote object access - those are implementation patterns layered on top of SOAP's messaging foundation.

Multiple choice technology web technology
  1. True

  2. False

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

JSP (JavaServer Pages) technology is designed to be extensible through custom tag libraries, tag files, and integration with servlets and JavaBeans. This extensibility allows developers to create reusable components and separate presentation logic from business logic.

Multiple choice technology web technology
  1. JSP standard directives.

  2. JSP standard actions.

  3. Script language declarations, scriplets and expressions.

  4. A portable tag extension mechanism.

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

The JSP specification comprehensively defines standard directives (page, include, taglib), standard actions (jsp:include, jsp:forward, jsp:useBean), script elements (declarations, scriptlets, expressions), and a portable tag extension mechanism for custom tags. All these components form the complete JSP feature set.

Multiple choice technology web technology
  1. Objects with page scope are accessible only within the page where they are created

  2. • References to objects with page scope are stored in the pagecontext object

  3. All references to such an object shall be released after the response is sent back to the client from the JSP page or the request is forwarded somewhere else.

  4. All of the above.

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

Page scope in JSP is the most limited scope - objects are accessible only within the specific JSP page where they are created. References are stored in the implicit pageContext object, and all references are automatically released when the response is completed or the request is forwarded to another resource.

Multiple choice technology web technology
  1. True

  2. False

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

The response.sendRedirect() method is indeed used to redirect the browser to a different resource. This sends an HTTP 302 status code to the client, causing the browser to make a new request to the specified URL. This is a client-side redirect, unlike jsp:forward which is server-side.

Multiple choice technology web technology
  1. Another JSP

  2. Plain text file

  3. Servlet

  4. CGI Program

  5. All of the above

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

The action can include output from various resources including other JSP pages, plain text files, servlets, and even CGI programs through the servlet container's resource handling mechanisms. This makes it a flexible tool for composing dynamic content from multiple sources.

Multiple choice technology web technology
  1. Using the <jsp:readParam/> action

  2. Using the <jsp:getParam/> action

  3. Use the request.getParameter() method

  4. Use the response.getParameter() method

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

When passes parameters to the included page, those parameters become part of the HTTP request. The included page accesses them using the standard request.getParameter() method, just like any other request parameter, because jsp:include uses a request-time inclusion mechanism.

Multiple choice technology programming languages
  1. page

  2. pageContext

  3. context

  4. object

  5. jspPave

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

pageContext is the implicit JSP object that provides access to all other implicit objects and page-related information. The page object refers to the current servlet instance, context is not a valid implicit object name (it's application), and object/jspPave don't exist.

Multiple choice technology programming languages
  1. True

  2. False

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

When isThreadSafe="false" is set in the page directive, the JSP container generates a servlet implementing SingleThreadModel. This interface ensures thread safety by serializing requests through the servlet, though it's deprecated in modern servlet specs.