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
-
Applet
-
Servlets
-
Scriptlet
-
Both b& c
B
Correct answer
Explanation
Servlets are Java programs that extend server capabilities, handling client requests and generating dynamic responses. They run within a web container and provide request/response processing functionality for Java-enabled web servers, making them ideal modular extensions.
-
Web Server
-
Web container
-
Super Class
-
None of the above
-
Java Web Server
-
Jrun
-
Apache Server
-
All the above
D
Correct answer
Explanation
Java Web Server, JRun, and Apache Server (configured with a servlet container like Tomcat) are all historically valid servers capable of developing and deploying Java Servlets. Thus, 'All the above' is correct.
-
HTTP Communication
-
Socket Communication
-
RMI Communication
-
All the above
D
Correct answer
Explanation
Applets can communicate with servlets through multiple mechanisms. HTTP is the most common method using URL connections. Socket communication allows direct TCP/IP connections, and RMI enables Java-to-Java remote method calls. All three methods are valid for applet-servlet communication.
-
Displaying page data
-
Connecting to database
-
Routing Requests
-
Performing front end validations
C
Correct answer
Explanation
In MVC architecture implemented with servlets, the Servlet acts as the Controller, receiving requests and routing them to appropriate Model components and View pages. The Controller handles request processing flow, not direct database connections, page display, or frontend validations which are handled by other components.
-
Home Interface
-
Remote Interface
-
Bean Class
-
All the above
D
Correct answer
Explanation
Stateful session beans in EJB (Enterprise JavaBeans) architecture consist of three components: the Home Interface for lifecycle management, the Remote Interface for client access, and the Bean Class containing business logic.
C
Correct answer
Explanation
EAR (Enterprise Archive) files contain EJB modules along with other application components like web modules (WAR files) and utility JARs. The EAR format packages all modules of a Java EE enterprise application.
-
ejbCreate()
-
ejbPassivate(),
-
ejbActivate()
-
All the above
D
Correct answer
Explanation
Session beans have callback methods that the container invokes at specific lifecycle points. ejbCreate() is called when a bean instance is created. ejbActivate() is called when a passivated bean is activated (moved from secondary storage to memory). ejbPassivate() is called when a stateful session bean is passivated (moved to secondary storage to conserve resources). All three are valid callback methods.
-
Java Transaction Service
-
Java Translation Service
-
Java Transaction Servlet
-
Java Translation Servlet
A
Correct answer
Explanation
JTS (Java Transaction Service) is the Java specification for transaction management. It defines the APIs and architecture for managing transactions across distributed systems in Java EE applications. The other options confuse 'Transaction' with 'Translation' or incorrectly identify it as a Servlet.
-
jspInit()
-
jspDestroy()
-
_jspService()
-
None of the above
C
Correct answer
Explanation
In JSP, the _jspService() method is automatically generated by the container and is responsible for handling HTTP requests. It receives HttpServletRequest and HttpServletResponse objects as parameters, similar to the service() method in servlets. jspInit() is for initialization (no parameters), jspDestroy() is for cleanup (no parameters). Therefore, _jspService() is the correct answer.
-
jspInit()
-
jspDestroy()
-
_jspService()
-
Both a & b
D
Correct answer
Explanation
JSP lifecycle allows overriding jspInit() for initialization and jspDestroy() for cleanup, but _jspService() is container-generated and cannot be overridden.
B
Correct answer
Explanation
WAR (Web Application Archive) files contain web applications ready for deployment on servlet/JSP containers like Tomcat or Jetty. They bundle HTML, JSP, JavaScript, classes, and configuration files.
-
Cookies
-
URL rewriting
-
HttpSession
-
All the above
D
Correct answer
Explanation
Session tracking can be implemented through multiple mechanisms: Cookies (stored on client), URL rewriting (appending session ID to URLs), and HttpSession (server-side session management). All three are valid approaches.
-
HttpRequest
-
XMLHttpRequest
-
JSON
-
XMLHttp
B
Correct answer
Explanation
The XMLHttpRequest object enables asynchronous communication with the server. It allows updating parts of a page without reloading by fetching data in the background.
-
responseText
-
onreadystatechange
-
oncompletion
-
readyState
D
Correct answer
Explanation
The readyState property indicates the current status of the XMLHttpRequest. It holds values from 0 (unsent) through 4 (completed), allowing scripts to track request progress.