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
Bean Scopes
Suppose you are working on an application that involves encrypting passwords before storing them in the
(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
Trending now
This is a popular solution!
Step by step
Solved in 2 steps