简体   繁体   中英

Migrating application from Spring to CDI

I would like to migrate an application from Spring 3 to Weld. In order not to rewrite the whole bean configuration at once, it would be cool if I could inject part of the application that is still written in Spring in the new CDI part.

Is that possible?

This should be possible. CDI has an extension system where you can hook into the injection mechanism. From there you can manually bootstrap your Spring beans and then return those.

I wouldn't be surprised if there's already an extension for this, so before looking into writing one yourself check if there's not one already.

There have been a few attempts at making CDI and Spring work together. Take a look at CDI Advocate for one.

It comes down to how much of your app is spring. If you're running something like Spring MVC, it'll be very difficult since it manages essentially your whole app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM