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 general knowledge
  1. Entity bean

  2. Stateless session bean

  3. Servlet

  4. Applet

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

A Servlet is the recommended J2EE component for use as a front controller in an MVC-based web application. Servlets provide the necessary HTTP request handling capabilities, can intercept and route requests, and are designed to coordinate between models and views. Entity beans are for data persistence, session beans for business logic, and applets run client-side.

Multiple choice general knowledge
  1. JDBC

  2. JMS

  3. JTA

  4. JTS

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

JMS (Java Message Service) enables distributed communication between J2EE components through asynchronous messaging. JDBC is for database connectivity, JTA for transaction management, and JTS is the transaction service implementation - these don't provide inter-component communication.

Multiple choice general knowledge science & technology
  1. WebSphere

  2. Apache

  3. IIS

  4. Sun Java System Web Server

  5. Both A & D

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

Apache HTTP Server is the most widely used open-source web server software, freely available for anyone to use and modify. WebSphere is IBM's proprietary commercial web server, IIS is Microsoft's proprietary server, and Sun Java System Web Server (now Oracle) is also closed-source.

Multiple choice general knowledge
  1. JBoss

  2. IIS

  3. Jetty

  4. Apache Tomcat

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

This question tests knowledge of web/application servers. IIS (Internet Information Services) is Microsoft's proprietary web server software, while JBoss, Jetty, and Apache Tomcat are all Java-based application servers that are open source or have open source versions. IIS is the odd one out as it's Windows-specific and not Java-based.

Multiple choice general knowledge
  1. MAYSCRIPT

  2. CODE

  3. PARAM

  4. CODEBASE

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

The MAYSCRIPT attribute is an HTML attribute (not a JavaScript feature) used in tags to explicitly grant Java applets permission to access JavaScript objects and functions. This is a security feature - applets cannot access JavaScript unless this attribute is present. CODE, PARAM, and CODEBASE are other applet attributes.

Multiple choice general knowledge science & technology
  1. close

  2. init

  3. destroy

  4. service

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

The servlet lifecycle has three core methods defined in the Servlet interface: init() (called once during initialization), service() (called for each request to process client requests), and destroy() (called once before removal). These methods manage the servlet's creation, request handling, and cleanup. The close() method is not part of the standard servlet API.

Multiple choice general knowledge science & technology
  1. javax.http

  2. jaxax.http.servlet

  3. javax.servlet.http

  4. javax.servlet

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

GenericServlet is an abstract class in the javax.servlet package that implements the Servlet interface and provides basic functionality for protocol-independent servlets. It serves as the foundation for HttpServlet, which is in javax.servlet.http and handles HTTP-specific operations. The package javax.http does not exist in Java EE.

Multiple choice general knowledge science & technology
  1. SinglethreadModel

  2. SingleThreadedModel

  3. SingleThreadModel

  4. SingleThreadmodel

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

The SingleThreadModel interface in the Servlet API ensures thread safety by guaranteeing that the servlet handles only one request at a time. The servlet container either serializes requests through the servlet or maintains a pool of servlet instances. Options A, B, and D have incorrect spelling/casing - the actual interface name is SingleThreadModel (with capital T, capital M, no 'ed').

Multiple choice general knowledge science & technology
  1. Servlet

  2. ServletContext

  3. ServletConfig

  4. ServletInit

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

ServletConfig provides access to a servlet's initialization parameters defined in web.xml using getInitParameter(). ServletContext is for application-wide parameters (accessed via context-param), Servlet is the base interface, and ServletInit is not a valid interface. Each servlet gets its own ServletConfig object during initialization.

Multiple choice general knowledge science & technology
  1. getRequestDispatcher("www.google.com").forward(req,resp);

  2. getRequestDispatcher("www.google.com").include(req,resp);

  3. resp.include(req,resp);

  4. resp.forward(req,resp)

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

The include() method from RequestDispatcher performs dynamic inclusion - it includes the response from another resource during request processing. forward() transfers control completely, and HttpServletResponse doesn't have include/forward methods that take request/response directly. Dynamic inclusion generates content at runtime.

Multiple choice general knowledge science & technology
  1. True

  2. False

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

By default, servlet containers use a single servlet instance to handle multiple requests concurrently, each in its own thread. This multithreaded model improves performance and resource utilization. To make a servlet thread-safe (single-threaded), you must implement the SingleThreadModel interface.

Multiple choice general knowledge science & technology
  1. Use of non Parameterized API

  2. Unauthorised access to any webpage /webdata directly or indirectly.

  3. Ignoring the updates to install.

  4. None of the Above.

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

Insecure Direct Object References occur when an application exposes internal object references (like database keys, file paths, or directory entries) without proper access control validation. Option (B) 'Unauthorised access to any webpage/webdata directly or indirectly' describes this - attackers manipulate direct object references to access unauthorized data. Option (A) relates to injection, (C) is about patching, and (B) correctly describes IDOR.

Multiple choice general knowledge science & technology
  1. Mule ESB

  2. JBoss ESB

  3. Websphere ESB

  4. SOPERA ASF

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

Mule ESB, JBoss ESB, and SOPERA ASF are all open-source Enterprise Service Bus implementations. Mule ESB (now MuleSoft) is a widely used open-source integration platform. JBoss ESB was the open-source ESB from Red Hat (now superseded by JBoss Fuse). SOPERA ASF is also an open-source ESB. Websphere ESB, however, is IBM's commercial (proprietary) offering and is not open-source.