Slide 21
Slide 21 text
21 | JavaOne 2014 | Migrating a JSF-based web application from Spring 3 to Java EE 7 and CDI | M.-Leander Reimer
Basic Spring to CDI annotation migration
is straightforward, with subtle differences
Caution: Spring and CDI have a different default scope!
CDI uses client proxies per default (except for @Dependent), in
Spring you have to do this explicitly.
This might influence your wiring style. Be careful with final.
Spring Annotation CDI Annotation
@Component(„myBean“) @Named(„myBean“)
@Scope(„singleton“) @ApplicationScoped
@Scope(„prototype“) @Dependent
@Scope(„request“) @RequestScoped
@Scope(„session“) @SessionScoped
@Autowired @Inject
Default
Default