I was trying to run a spring program with different style. I am new to this framework.
I tried to load configuration file with types of loader. like
(1) BeanFactory factory = new XmlBeanFactory(new FileSystemResource("spring.xml")); (2) ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml"); (3) ApplicationContext context = new FileSystemXmlApplicationContext("/spring.xml");
But in second, I am getting exception that filenotfound.
And same thing i am doing in web application. In my web application configuration file is located exactly in WEB-INF folder. So i could load it as follow.
ApplicationContext context = new ClassPathXmlApplicationContext("/WEB-INF/application-context.xml");
Please give me suggestion. Please be specific with reason.