Spring Study Notes

Source: Internet
Author: User

I have never touched spring knowledge for a long time. I hope I can take a good look at it. Of course, the time is not enough. Of course, I personally do not have much energy. There are still some tricky things on Saturday, so I can only write something when I am clear.Code.

The first step is to run spring as a Java project.ProgramIn fact, let's test how to use the spring container. I learned it through watching the video. It is very detailed and the operations are clear. I am very depressed that the jar package and source code package of spring cannot be found on the official website for download, and other places cannot find good resources. There is no way to do this, you will find the package that you use and reference it to the program. The configuration file template is roughly as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <Beans xmlns = "http://www.springframework.org/schema/beans" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: context = "http://www.springframework.org/schema/context" xmlns: Tx = "http://www.springframework.org/schema/tx" xsi: schemalocation = "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx hsttp: // www.springframework.org/schema/tx/spring-tx-2.5.xsd "default-autowire =" byname "default-Lazy-init =" true "> </beans>

Most of the configuration files are stored in the class path, that is, the src directory. There are two ways to load the configuration file: one is to find the configuration under the class path
File, of course, this is also the most commonly used, the call method is:

applicationcontext cxt = new classpathxmlapplicationcontext (New String [] {"Beans. xxml"}); the configuration file can be one or multiple. Another way is to find the path in the file system, which requires an absolute path. Considering the porting problem of the program, this method is not feasible. (To be continued)

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.