• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Query regarding loading the application.xml file inside servlet

 
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have mentioned the





Are these above two steps are sufficient .

OR

Do i still need to use WebApplicationContext to load the XML files ??
 
Marshal
Posts: 67298
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask Spring questions in the Frameworks forum. I have moved this post there for you.
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those first two just puts an ApplicationContext object, with your created beans, into the WebContext.

If you want access to it directly in a Servlet class, then you shoudl use the WebContextUtils class to get the reference to the ApplicationContext to lookup your Beans.

If you are using say Struts or Spring MVC, then there is classes already created that allow you to inject your beans into those classes. ActionSupport from Spring for Struts, and Controller classes for Spring MVC.

Mark
 
We noticed he had no friends. So we gave him this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!