Advertisement
Guest User

Untitled

a guest
Dec 8th, 2011
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. package helloworld;
  2.  
  3. import org.springframework.context.ApplicationContext;
  4. import org.springframework.context.support.ClassPathXmlApplicationContext;
  5.  
  6. public class Main {
  7.     public static void main(String[] args) {
  8.         ApplicationContext context =
  9.             new ClassPathXmlApplicationContext(new String[] {"services.xml"});
  10.        
  11.         // retrieve configured instance
  12.         MyHelloWorld service = context.getBean("greeting", MyHelloWorld.class);
  13.         // use configured instance
  14.        
  15.         System.out.println(service.getGreeting());
  16.     }
  17. }
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement