The ApplicationContext of Spring Learning notes

Source: Internet
Author: User

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/A6/AE/wKioL1nYho6QUkG4AACCfECODXY726.png "title=" 2017-10-07_154540.png "alt=" Wkiol1nyho6qukg4aaccfecodxy726.png "/>


650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/A6/AE/wKioL1nYh6uDxqxkAAAlysy5K_M191.png "style=" float : none; "title=" 2017-10-07_154759.png "alt=" Wkiol1nyh6udxqxkaaalysy5k_m191.png "/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/07/FD/wKiom1nYh_mjEQOAAAD8t-ei_Qs835.png "style=" float : none; "title=" 2017-10-07_155153.png "alt=" Wkiom1nyh_mjeqoaaad8t-ei_qs835.png "/>

For a application to provide the configuration of the core interface, it is read-only when the application is running.

A applicationcontext provides the following capabilities:

1, you can access the application components through the method in Beanfactory

2. File resources can be loaded

3. Can send events to registered listeners

4, can parse the message, support internationalization

5, can inherit from the parent context, of course, defined in the sub-context (or called background context) always has priority. This means, for example, that a single parent-level context can be used throughout the Web application, and each servlet has its own sub-context and is independent, not related to the other servlets.

(

What is the meaning of this sentence, my understanding is:

1. Contexts can be inherited, which means that the beans defined in the context of the parent level can be used in the context of the child level, provided that the two contexts are parent-child relationships.

2. can access its inherited parent context in a web context

3. Each servlet can have its own context, and the servlet is independent of each other

4. The child context always has precedence, meaning that if there is a child context with the same bean as the parent context, then the bean in the child context is given priority access.

)


The first we saw were Annotationconfigapplicationcontext and Classpathxmlapplicationcontext, They represent annotation-based applicationcontext and XML-based ApplicationContext, respectively, and look at

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/07/FD/wKiom1nYjWvTWXcRAABUHWrNLiw607.png "style=" float : none; "title=" 2017-10-07_161453.png "alt=" Wkiom1nyjwvtwxcraabuhwrnliw607.png "/>

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A6/AF/wKioL1nYjR3j9sXwAAAt6B-fMek730.png "style=" float : none; "title=" 2017-10-07_161505.png "alt=" Wkiol1nyjr3j9sxwaaat6b-fmek730.png "/>




This article is from the "ten-li Rice flower" blog, please be sure to keep this source http://5880861.blog.51cto.com/5870861/1970623

The ApplicationContext of Spring Learning notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.