-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawingApp.java
More file actions
38 lines (22 loc) · 944 Bytes
/
DrawingApp.java
File metadata and controls
38 lines (22 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package org.ribhu.javabrains;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.FileSystemResource;
@SuppressWarnings("deprecation")
public class DrawingApp {
public static void main(String[] args) {
try {
// Triangle triangle = new Triangle();
// BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource("spring.xml"));
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");
// Triangle triangle = (Triangle) beanFactory.getBean("triangle");
Triangle triangle = (Triangle) applicationContext.getBean("triangle-name");
triangle.draw();
}
catch (Exception e) {
System.err.println(e.getMessage());
}
}
}