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. cookie.setMaxAge(int seconds)

  2. cookie.setMaxAge(float seconds)

  3. cookie.setAgeMax (float seconds)

  4. cookie.setAgeMax (int seconds)

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

The Cookie class in Java servlets/JSP uses setMaxAge(int seconds) to set the cookie's maximum age in seconds. The parameter must be an integer, not a float. Negative values delete the cookie, zero deletes it immediately, and positive values set the expiration time.

Multiple choice technology web technology
  1. HTTP Communication (Text-based and object-based)

  2. Socket Communication

  3. RMI Communication

  4. None of these

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

Applets can communicate with servlets using HTTP requests (sending text or serialized objects), direct TCP/IP sockets, or Remote Method Invocation (RMI). Since all three communication mechanisms are valid, marking them all as correct in this multiple-response question is accurate.

Multiple choice technology web technology
  1. out class refers to the output stream for the http page

  2. page class refers to the page Servlet interface

  3. pageContext refers to the pages Servlet interface

  4. config interface refers to the servlets configuration.

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

All options describe JSP implicit objects correctly. 'out' is JspWriter for response output. 'page' is reference to the current servlet instance (this). 'pageContext' is PageContext providing access to all scopes and attributes. 'config' is ServletConfig containing initialization parameters. These are standard JSP implicit objects.

Multiple choice technology web technology
  1. Model

  2. View

  3. Controller

  4. None of the above

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

In MVC architecture, JSP pages serve as the View layer responsible for presentation and display. The Model represents data and business logic (Java beans, EJBs). The Controller manages flow and request handling (Servlets, Struts actions). JSP templates display data provided by the controller.

Multiple choice technology web technology
  1. jspInit(), jspDestroy(), init() , destroy()

  2. init(),jspDestroy(),jspInit(),destroy()

  3. destroy(),jspDestroy(),jspInit(),init()

  4. init(),destroy(),jspInit(), jspDestroy()

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

The JspPage interface defines the jspInit() and jspDestroy() lifecycle methods, which correspond to the init() and destroy() methods in standard servlets. The stored answer correctly maps these methods in the right order, whereas other options incorrectly mix or misalign the relationships.

Multiple choice technology web technology
  1. Objects with session scope are accessible from pages processing requests that are in the same session as the one in which they were created.

  2. It is not legal to define an object with session scope from within a page that is not session-aware.

  3. All references to the object shall be released after the associated session ends.

  4. References to objects with session scope are stored in the session object associated with the page activation.

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

All statements correctly describe session scope in JSP. Session scope means objects persist across multiple requests from the same user. Non-session-aware pages (with session='false') cannot access session scope. Session-scoped objects are automatically released when the session invalidates or expires. References are stored in the HttpSession object.

Multiple choice technology
  1. UDDI is a directory for storing information about web services

  2. UDDI is a directory of web service interfaces described by WSDL

  3. UDDI does not communicate via SOAP

  4. UDDI is built into the Microsoft .NET platform

Reveal answer Fill a bubble to check yourself
A,B,D Correct answer
Multiple choice technology
  1. Service Callout

  2. Java Callout

  3. Publish

  4. Route Node

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

Java Callout is the OSB action for calling Plain Old Java Objects (POJOs) from service flows. Service Callout invokes another OSB/proxy service, Publish is one-way messaging, Route Node is for request routing - only Java Callout calls POJOs.

Multiple choice technology
  1. XML variables

  2. XML variables shared across the request flow.

  3. XML variables shared across response flow.

  4. XML variables shared across request and response flows.

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

The OSB message context is a container for XML variables that persists throughout the entire message lifecycle - both the request pipeline and the response pipeline. Variables set during request processing are available during response processing, enabling data to be carried forward. Option D correctly captures this bidirectional sharing, while A is incomplete and B/C only describe half of the picture.