Which of the following should NOT be used to share data between servlets in a distributed web application?

  1. Attributes of ServletContext

  2. Enterprise Java Beans

  3. Attributes of HttpSession

  4. Database


Correct Option: A

AI Explanation

To answer this question, you need to understand the different ways of sharing data between servlets in a distributed web application.

Option A) Attributes of ServletContext - This option is incorrect because ServletContext attributes can be used to share data between servlets in a distributed web application. ServletContext is a global object that is accessible to all servlets running within the same web application.

Option B) Enterprise Java Beans (EJB) - This option is incorrect because EJBs can be used to share data between servlets in a distributed web application. EJBs are a server-side component model in Java EE that provides a way to write reusable and scalable business logic.

Option C) Attributes of HttpSession - This option is incorrect because HttpSession attributes can be used to share data between servlets in a distributed web application. HttpSession is an object that represents a user session and can store data that is specific to that session.

Option D) Database - This option is incorrect because a database can be used to share data between servlets in a distributed web application. Servlets can store and retrieve data from a database to share information between different components of the application.

The correct answer is A) Attributes of ServletContext. This option is incorrect because ServletContext attributes can be used to share data between servlets in a distributed web application.

Find more quizzes: