Spring Java Configuration

I have a Spark application to which I introduced the spring core to do dependency injection.

I taught I was smart by having the same class name but in different packages to show which steps were related but that backfired because component scanning can’t handle all these classes with the same name. I will have to figure out a solution to this that does not involve specifying each as @Bean in the Spring configuration class.

I also learned how to specify many packages to be component scanned:

@ComponentScan({“package1”, “package2”, “package3”})

As simple as a string array.

Published by


Java developper that loves photography and an excellent espresso

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s