Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.spring1.learning;
- import org.springframework.context.ApplicationContext;
- import org.springframework.context.support.ClassPathXmlApplicationContext;
- /**
- * Created by marcel on 03.02.17.
- */
- public class MainApp {
- public static void main(String[] args) {
- ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
- HelloWorld obj = (HelloWorld) context.getBean("HelloWorld");
- obj.getMessage();
- }
- }
- package com.spring1.learning;
- /**
- * Created by marcel on 03.02.17.
- */
- public class HelloWorld {
- private String message;
- public void setMessage(String message){
- this.message = message;
- }
- public void getMessage(){
- System.out.println("Your Message : " + message);
- }
- }
Add Comment
Please, Sign In to add comment