I have a simple question, How could I use spring @Autowired on a constructor of this Scala class?
class MessageMBeanExporter(messageDirectory: MessageDirectory) extends MBeanExporter with SmartLifecycle {
.....
}
I've added support for @Autowired on the constructor of a Scala object into the spring-scala project. This is only (at time of writing) in the nightly snapshot.
This allows you to do
@Component
@Autowired
class Service(dep : Dependency) { }
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.