Maven & Springboot

This commit is contained in:
2022-06-14 11:45:09 +05:30
parent a6509debfd
commit fcb5ad1ec7
13 changed files with 203 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
package demo;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Main {
public static void main(String[] args) {
// Getting application context and configuring class path of the xml file
AbstractApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
student st = context.getBean(student.class); // Spring get bean method
st.studyJava(); // Calling the method studyJava from student class
System.out.println(student.getName()); // Using get name method to print the value of variable name
}
}