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 security
  1. a

  2. b

  3. c

  4. d

  5. Option 1 AND Option 2

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

HTTP PUT and DELETE can be disabled via web.xml configuration as shown in option A. Option B is also true as many servers disable them by default for security. E combines both correct statements.

Multiple choice technology security
  1. Subject.doAs()

  2. AccessController.checkPermission()

  3. SecurityManager.checkAccess()

  4. None of the above

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

Subject.doAs() is the correct API that associates a Subject with the current thread of execution in Java authentication and authorization. It executes an action as that Subject. AccessController.checkPermission() checks permissions but doesn't associate subjects with threads. SecurityManager.checkAccess() checks thread access control, not subject association.

Multiple choice technology security
  1. Server.xml

  2. config.xml

  3. web.xml

  4. application.properties

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

In J2EE web applications, the web.xml deployment descriptor file defines application-wide configurations including error pages. You specify error pages using elements that map exception types or HTTP error codes to custom display pages. Server.xml (A) is for server-level configuration in Tomcat, config.xml (B) is not a standard J2EE config file, and application.properties (D) is typically used for application-specific settings, not servlet container configurations.

Multiple choice technology web technology
  1. HttpSession

  2. ServletRequest

  3. ServletResponse

  4. ServletContext

  5. ServletConfig

  6. SessionConfig

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

HttpSession, ServletRequest, and ServletContext all define getAttribute() and setAttribute() methods to manage attributes within their respective scopes. ServletConfig only supports getInitParameter() and does not have attribute methods.

Multiple choice technology web technology
  1. HttpSessionEvent

  2. ServletRequestEvent

  3. HttpSessionBindingEvent

  4. HttpSessionAttributeEvent

  5. ServletContextAttributeEvent

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

In J2EE 1.4 API, HttpSessionBindingEvent exists for session attribute binding/unbinding, but HttpSessionAttributeEvent does not exist. HttpSessionEvent, ServletRequestEvent, and ServletContextAttributeEvent are all valid listener event types in the specification.

Multiple choice technology web technology
  1. req.getSession()

  2. req.getSession(true)

  3. req.getSession(false)

  4. req.createSession()

  5. req.createSession(true)

  6. req.createSession(false)

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

getSession() (no-arg) and getSession(true) both create a new session if one doesn't exist. getSession(false) returns null if no session exists, without creating one. The createSession() methods do not exist in the HTTPServletRequest API.

Multiple choice technology web technology
  1. sendURL()

  2. redirectURL()

  3. sendRedirect()

  4. getRequestDispatcher()

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

sendRedirect(String url) is the correct method on HttpServletResponse to redirect the client to a different URL. This sends a temporary redirect (HTTP 302) to the browser. getRequestDispatcher() is for server-side forwards, not redirects.

Multiple choice technology web technology
  1. Only jspInit() can be overridden

  2. Only jspDestroy() can be overridden

  3. Only _jspService() can be overridden()

  4. Both jspInit() and jspDestroy() can be overridden

  5. jspInit(), jspDestroy() and _jspService() can all be overridden

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

JSP lifecycle includes jspInit() for initialization and jspDestroy() for cleanup, both of which can be overridden by developers. The _jspService() method is generated by the container and cannot be overridden - it's where your JSP code ultimately executes.

Multiple choice technology
  1. Gathers templates and data and builds an HTML page

  2. Displays the HTML page on the client’ s computer

  3. Provides access to, and distributes load for Siebel Servers

  4. Verifies that the client is using an acceptable browser

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

The Siebel Web Engine's core function is receiving a URL request, gathering the appropriate templates and data from the database, and constructing an HTML page to return. It doesn't display the page (browser does), distribute load (that's the SWSE), or verify browsers (client-side check).

Multiple choice technology web technology
  1. PsPageMetaData

  2. PsPageFlowController

  3. PsPageData

  4. PsPageMetaDataReader

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

PsPageData is the object that provides page authors with consistent, standardized access to application data. PsPageMetaData contains metadata information, PsPageFlowController handles navigation logic, and PsPageMetaDataReader is for reading metadata - none of these provide the data access mechanism.

Multiple choice technology web technology
  1. Bean name

  2. servlet code

  3. Tag library descriptor file

  4. Implementation of the tag

  5. jsp code

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

A JSP tag library consists of three key components: the Tag Library Descriptor (TLD) file that defines the tags (C), the actual implementation code for each tag (D), and the JSP code that uses the tags (E). Bean name (A) is not a component of the tag library itself - it's data managed by the bean. Servlet code (B) is not directly part of tag library structure. Options C, D, and E are correct.