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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Lock objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT