官术网_书友最值得收藏!

The web application context

In a Spring-based application, our application objects live within an object container. This container creates objects and associations between objects, and manages their complete life cycle. These container objects are called Spring-managed beans (or simply beans), and the container is called an application context in the Spring world.

A Spring container uses dependency injection (DI) to manage the beans that make up an application. An application context (org.springframework.context.ApplicationContext) creates beans and associate beans together based on the bean configuration and dispenses beans on request. A bean configuration can be defined via an XML file, annotation, or even via Java configuration classes. We will use only XML- and annotation-based bean configurations in our chapters.

A web application context is the extension of an application context, designed to work with the standard servlet context (javax.servlet.ServletContext). A web application context typically contains frontend-related beans, such as views and view resolvers. In the first chapter, we created an XML file called DefaultServlet-servlet.xml, which is nothing but a bean configuration file for our web application context.

主站蜘蛛池模板: 沁水县| 安乡县| 锦州市| 忻州市| 新密市| 元阳县| 南丰县| 岗巴县| 屏东市| 文成县| 扶沟县| 南汇区| 潜江市| 寿阳县| 桐乡市| 娄底市| 保山市| 综艺| 武汉市| 民勤县| 开远市| 石狮市| 龙井市| 郎溪县| 建湖县| 高邑县| 金阳县| 襄垣县| 凤山县| 拜泉县| 沙雅县| 平阴县| 大安市| 托克逊县| 韶关市| 大埔区| 苍山县| 天津市| 岱山县| 鄂温| 东辽县|