| Author |
Spring with Hibernate Integration
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hello i am trying to learn .
After defining all the beans for Datasource , SessionFactory and more in the springs xml file , Can anybody tell me how the application will actually load this xml file in case of a web based application ?
Thanks in advance .
|
Save India From Corruption - Anna Hazare.
|
 |
everson santos
Ranch Hand
Joined: Jul 11, 2009
Posts: 50
|
|
Try this in your web.xml
<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
</param-value>
</context-param>
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Thank you very much , and one more query
Is it sufficient to mention it like this or do i need to call this the context params in the Application also to load the XML file ??
|
 |
everson santos
Ranch Hand
Joined: Jul 11, 2009
Posts: 50
|
|
Only like that.
For me work. I'm greenhorn with spring
|
 |
Eduardo Bueno
Ranch Hand
Joined: Jun 04, 2009
Posts: 154
|
|
|
It is sufficient, the ContextLoader will scan through your applicationContext.xml and do whatever it finds in there.
|
 |
 |
|
|
subject: Spring with Hibernate Integration
|
|
|