Hi,
I am developing a small spring mvc app.
I have spring-context.xml file containing spring MVC's dispatcher
servlet configuration.
root-context.xml as application context.
I am declaring my Datasource/daoimpl beans in root-context.xml file.
How do i access root-context.xml file in controller class and invoke getBeans() method on it to get the beans?
Below is lines of code from controller class.
This is one of the several ways I tried accessing it.
root-context.xml file is declared in web.xml file as context param.
Is there a way I can access this "contextConfigLocation" parameter in my controller class to access this xml file?
Complete path of all the files mentioned is :
/SpringMVCStudent/src/main/webapp/WEB-INF/spring/
root-context.xml
/SpringMVCStudent/src/main/java/java9s/springmvcstudent/controller/
StudentController1.java
/SpringMVCStudent/src/main/webapp/WEB-INF/spring/appServlet/
servlet-context.xml
/SpringMVCStudent/src/main/webapp/WEB-INF/
web.xml
Its a problem in one trivial line of code which took my entire day and still not solved.
Thanks in advance