TechSpellBound
TechSpellBound

Reputation: 2555

Name of a bean which is annotated with @Named without specifying any string in @Named?

Suppose I have a bean which is injected using @Named annotation. For example,

@Named
public class MyBean {}

What will be the name of the bean during run time? I searched the net but couldn't find an answer. Also don't know how to debug to find the name.

Upvotes: 2

Views: 311

Answers (1)

Abdullah Shaikh
Abdullah Shaikh

Reputation: 2604

The name of the bean would be the class name.

Example : class CustomerService would be named customerService

Upvotes: 1

Related Questions