Bean Scopes Suppose you are working on an application that involves encrypting passwords before storing them in the database. The encryption part is carried out by a PasswordEncryptor class. This...



Bean Scopes


Suppose you are working on an application that involves encrypting passwords before storing them in the database. The encryption part is carried out by a PasswordEncryptor class. This class provides you with a method that takes a plaintext password and returns an encrypted one. You need to create a bean of this class. What should be the scope of this bean? Choose the correct option from those given below.


(Hint: PasswordEncryptor only contains methods and no fields to maintain state. Hence, we need to create a stateless bean of PasswordEncryptor. Recall which bean scope is used for creating stateless beans.)



1) Prototype



2) Singleton



3) Request



4) Session


Provide right solution



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here