This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query regarding loading the application.xml file inside servlet

 
PavanPL KalyanK
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 ??
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic