Getting Started with Spring (2)--written in front of the first case

Source: Internet
Author: User

1, introduce spring's jar file

Libs/spring-beans-3.2.2.release.jar

Libs/spring-context-3.2.2.release.jar

Libs/spring-context-support-3.2.2.release.jar

Libs/spring-core-3.2.2.release.jar

Libs/spring-expression-3.2.2.release.jar

Need:

Commons-logging-1.1.1.jar

2. Need to add spring's configuration file

The name of the configuration file can be named casually, but it's best to have practical meaning.

For example:

Spring-dao.xml

Spring-service.xml

Spring.xml

3. How spring configuration files introduce beans constraints

---spring-framework-3.2.2.release-dist/spring-framework-3.2.2.release/docs/spring-framework-reference/html/ Index.html

Table of Contents:

5.2.1. Configuration Metadata Click in

You can copy the original message:

<?xml version= "1.0" encoding= "UTF-8"?>

<beans xmlns= "Http://www.springframework.org/schema/beans"

xmlns:xsi= "Http://www.w3.org/2001/XMLSc hema-instance"

Xsi:schemalocation= "Http://www.springframework.org/schema/beans

Http://www.springfra mework.org/schema/beans/spring-beans.xsd ">

</beans>

4, the following is an instantiation: container

Read the file parameter dynamic parameters, individual parameters, arrays, and wildcard characters below the classes path

ApplicationContext context = new Classpathxmlapplicationcontext (

"Spring.xml");

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.