Created
September 6, 2017 09:05
-
-
Save OmarElgabry/eeffcf687e808b856efdd7e62d42eb48 to your computer and use it in GitHub Desktop.
Spring: A Head Start 🔥 — Beans Configuration (Part 2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.springframework.context.ApplicationContext; | |
| import org.springframework.context.support.ClassPathXmlApplicationContext; | |
| public class Test { | |
| public static void main(String[] args) { | |
| ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); | |
| App app = context.getBean("app", App.class); | |
| // App app = (App) context.getBean("app"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment