You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
poutsma edited this page Oct 24, 2012
·
11 revisions
Defining Scala Beans in Spring XML
The Spring container only supports bean properties that follow the JavaBean contract.
Properties on these classes are expressed using Java getters and setters (eg. String getFoo() and void setFoo(String)).
By default, Scala classes do not follow the JavaBeans contract.
In order to wire up Scala classes as Spring beans, one has to choose between the three different strategies, described below.
Constructor Injection
The easiest way to wire up a Scala Bean in a Spring XML application context is to simply use constructor injection.
For example, imagine we have the following Scala class: