This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.