@@ -5822,17 +5822,18 @@ you should use the `@Named` annotation as follows:
5822
5822
5823
5823
5824
5824
[[beans-named]]
5825
- === @Named: a standard equivalent to the @Component annotation
5825
+ === @Named and @ManagedBean: standard equivalents to the @Component annotation
5826
5826
5827
- Instead of `@Component`, `@javax.inject.Named` may be used as follows:
5827
+ Instead of `@Component`, `@javax.inject.Named` or `javax.annotation.ManagedBean` may be
5828
+ used as follows:
5828
5829
5829
5830
[source,java,indent=0]
5830
5831
[subs="verbatim,quotes"]
5831
5832
----
5832
5833
import javax.inject.Inject;
5833
5834
import javax.inject.Named;
5834
5835
5835
- @Named("movieListener")
5836
+ @Named("movieListener") // @ManagedBean("movieListener") could be used as well
5836
5837
public class SimpleMovieLister {
5837
5838
5838
5839
private MovieFinder movieFinder;
@@ -5869,8 +5870,8 @@ It is very common to use `@Component` without specifying a name for the componen
5869
5870
}
5870
5871
----
5871
5872
5872
- When using `@Named`, it is possible to use component scanning in the exact same way
5873
- as when using Spring annotations:
5873
+ When using `@Named` or `@ManagedBean` , it is possible to use component scanning in the
5874
+ exact same way as when using Spring annotations:
5874
5875
5875
5876
[source,java,indent=0]
5876
5877
[subs="verbatim,quotes"]
@@ -5884,8 +5885,9 @@ as when using Spring annotations:
5884
5885
5885
5886
[NOTE]
5886
5887
====
5887
- In contrast to `@Component`, the JSR-330 `@Named` annotation is not composable.
5888
- Please use Spring's stereotype model for building custom component annotations.
5888
+ In contrast to `@Component`, the JSR-330 `@Named` and the JSR-250 `ManagedBean`
5889
+ annotations are not composable. Please use Spring's stereotype model for building custom
5890
+ component annotations.
5889
5891
====
5890
5892
5891
5893
@@ -5906,7 +5908,7 @@ features are not available as shown in the table below:
5906
5908
| `@Inject` has no 'required' attribute; can be used with Java 8's `Optional` instead.
5907
5909
5908
5910
| @Component
5909
- | @Named
5911
+ | @Named / @ManagedBean
5910
5912
| JSR-330 does not provide a composable model, just a way to identify named components.
5911
5913
5912
5914
| @Scope("singleton")
0 commit comments