0 votes
in Spring by

How to create ApplicationContext in a Java Program?

1 Answer

0 votes
by

There are following ways to create spring context in a standalone java program.

AnnotationConfigApplicationContext: If we are using Spring in standalone java applications and using annotations for Configuration, then we can use this to initialize the container and get the bean objects.

ClassPathXmlApplicationContext: If we have spring bean configuration xml file in standalone application, then we can use this class to load the file and get the container object.

FileSystemXmlApplicationContext: This is similar to ClassPathXmlApplicationContext except that the xml configuration file can be loaded from anywhere in the file system.

Related questions

0 votes
asked Jul 27, 2020 in Spring by Robindeniel
+1 vote
asked Oct 24, 2020 in JAVA by sharadyadav1986
...