Spring configuration file Applicationcontext.xml Configuration header file parsing

Source: Internet
Author: User

Spring configuration file Applicationcontext.xml Configuration header file parsingoriginal December 16, 2016 14:22:43
    • Label:
    • Spring configuration file
    • 5446
Applicationcontext.xml Configuration header file parsing in Spring <?xmlversion= "1.0" encoding= "UTF-8"? ><beansxmlns= "http// Www.springframework.org/schema/beans "xmlns:xsi=" Http://www.w3.org/2001/XMLSchema-instance "xmlns:tx=" http://www . Springframework.org/schema/tx "xmlns:aop=" HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP "xmlns:context=" http:/ Www.springframework.org/schema/context "xsi:schemalocation=" Http://www.springframework.org/schema/beans http: Www.springframework.org/schema/beans/spring-beans-4.1.xsd Http://www.springframework.org/schema/context http:/ /www.springframework.org/schema/context/spring-context-4.1.xsdHttp://www.springframework.org/schema/txHttp://www.springframework.org/schema/tx/spring-tx-4.1.xsd HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP/HTTP Www.springframework.org/schema/aop/spring-aop-4.1.xsd "></beans> The first thing to do is to import the relevant jar package, Here's an example of AOP. Therefore, it is necessary to only import the four jar packages of the AOP-related jar packages. Jar Package: Http://pan.baidu.com/s/1nvTPNRV

Configuration header file referenced by package (version number to match on)

Step (1), download spring-framework-4.1.6

(2), Eclipse, click Window-preferances, enter the XML catalog in the popup box, see the following interface

Click Add

Select from the file where you downloaded the spring-framework-4.16 open folder, and then open the schema folder in this directory is the folder you want to introduce the relevant tags, the following is an example of an AOP tag, the other tags are the same procedure. (1), open the AOP folder. Then check spring-aop-4.1.xsd, click Punch in here to pay special attention to the location:f:\javaintegration\spring-framework-4.1.6.release-dist\ The green background text in the spring-framework-4.1.6.release\schema\aop\spring-aop-4.1.xsd is the same as in the green box in the picture, that is, the version must correspond, and the value in the red box is the value of key. In particular, the reason is that sometimes we will copy the header file from the Internet do not know the principle of this way, there will be a version does not correspond to the error

Attention!!! First of all, to ensure that the Http://www.springframework.org/schema/beans/spring-beans.xsd file schema location to be configured, or other schema Location even if the configuration will not come out!!! Second: key: The XSD file is best not to write the version number

The header file for this AOP is configured, and the other header file label configurations are similar.

Spring configuration file Applicationcontext.xml Configuration header file parsing

Related Article

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.