Skip to content

Instantly share code, notes, and snippets.

@OmarElgabry
Created September 6, 2017 09:05
Show Gist options
  • Select an option

  • Save OmarElgabry/eeffcf687e808b856efdd7e62d42eb48 to your computer and use it in GitHub Desktop.

Select an option

Save OmarElgabry/eeffcf687e808b856efdd7e62d42eb48 to your computer and use it in GitHub Desktop.
Spring: A Head Start 🔥 — Beans Configuration (Part 2)
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