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
-
Entity bean
-
Stateless session bean
-
Servlet
-
Applet
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.
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.
-
WebSphere
-
Apache
-
IIS
-
Sun Java System Web Server
-
Both A & D
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.
-
JBoss
-
IIS
-
Jetty
-
Apache Tomcat
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.
-
MAYSCRIPT
-
CODE
-
PARAM
-
CODEBASE
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.
-
$_SERVER['HTTP_USER_AGENT'];
-
$_SERVER['PHP_SELF']
-
$_SERVER['SERVER_NAME']
-
$_SERVER['HTTP_VARIENT']
-
close
-
init
-
destroy
-
service
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.
-
javax.http
-
jaxax.http.servlet
-
javax.servlet.http
-
javax.servlet
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.
-
SinglethreadModel
-
SingleThreadedModel
-
SingleThreadModel
-
SingleThreadmodel
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').
-
Servlet
-
ServletContext
-
ServletConfig
-
ServletInit
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.
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.
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.
-
Use of non Parameterized API
-
Unauthorised access to any webpage /webdata directly or indirectly.
-
Ignoring the updates to install.
-
None of the Above.
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.
-
Mule ESB
-
JBoss ESB
-
Websphere ESB
-
SOPERA ASF
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.
B
Correct answer
Explanation
LegStar is an open-source mainframe integration solution that connects legacy systems with modern applications. LDAP is an authentication protocol, WSRR is IBM's proprietary registry, and ERLANG is a programming language - none are mainframe integration tools.