Discover spring bean configuration xml file, include the articles, news, trends, analysis and practical advice about spring bean configuration xml file on alibabacloud.com
Packagecom.baobaotao.conf;importorg.springframework.beans.factory.annotation.autowired;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.configuration;import org.springframework.context.annotation.importresource;// Introduction of XML configuration file @configuration@
Detailed description of the instances in the JSP Spring configuration file, spring configuration file
Detailed description of the instances in the JSP Spring
Xml
Piecing together beans within the spring container is called assembly. When you assemble a bean, you are telling the container what beans are needed and how the container uses dependency injection to tie them together.In theory, the bean assembly can be obtained from any resource, including property files, relation
, create the xmlbeandefinitionreader.#2. Process the XML configuration file.#3. Handling resource.#4. Actual operation function:doloadbeandefinitions.#5. Process each element of the XML, the parsedefaultelement function in Defaultbeandefinitiondocumentreader. Different processing according to the label type.#6. Registe
indicated, such as String, then only the connection point (method) that returns the string type is matched. The name pattern matches the method name. You can use the * wildcard character to represent all method names. In the parameter pattern, () means that a method that does not accept any arguments is matched, and (.. ) represents a method that matches any number of parameters. A pattern (*) represents a method that matches any type of parameter. Pattern (*,string) indicates a match: the firs
I. XML configuration Method
The following is a typical spring configuration file (application-config.xml): [XML] view plain copy
Then you can use a bean like this: [Java] view plain co
matches the method name. You can use the * wildcard to match all method names. In parameter mode, () indicates that the method that does not accept any parameters is matched, and (..) The method that matches any number of parameters. Mode (*) indicates a method that matches any type of parameters. Mode (*, String) indicates matching: the first is of any parameter type, and the second must be of the String type.
2. configuration of AOP Based on Schema
When building the spring framework, The spring-related configuration in Web. XML can be configured without Org.springframework.web.context.ContextLoaderListener (that is, only with Org.springframework.web.servlet.Dispa Tcherservlet).
Yes, as long as you don't use spring's control inversion (that is, IOC) to use
SpringMVC configuration web. xml file (list common configurations), springmvcweb. xml
Common web. xml configuration
1. Spring framework solves the string encoding problem: FilterCharact
special characters FOR XMLThere are 5 special characters in the XML, namely,:When spring is in the XML configuration, if the property value contains a special symbol for the XML, we deliberately add a XML code
declares a property in the
If the injected value has a special character Furu "
The console prints a value of
(1) When injecting a property into a bean, if it contains other beans, you can specify a reference to the bean by the element or ref property for the Bean's property or constructor parameter.(2) A bean's declaration can also be included in a property or constructor, which is called an
Spring AOP-configuration based on XML files, aop-xml
The configuration of Spring AOP can be based on Annotations or XML files. The previous articles use annotations. The following descr
When a bean needs to access another bean, it can be displayed as a reference to assemble it. However, if your container can automatically assemble beans, you can save the trouble of manual configuration and assembly.
The Spring IoC container can help you automatically assemble beans. You only need to specify the auto
Recently using the spring Boot+mybatis, using IntelliJ idea to develop and document some of the solutions to the problem.1, in the case of using @mapper annotation instead of the Xxmapper.xml configuration file, using annotations such as @select to configure the SQL statement, how to configure the database field name to JavaBean entity class attribute life automa
system above are actually tightly coupled to the spring framework, because these classes know that they are running on the spring framework, so the system should minimize such applications and make the system as independent of the current operating environment as possible. Try to obtain the required service provider by means of Di.I think that the method of five more feasible, you can design a tool class,
Overview of Spring configuration filesSpring's configuration files are "drawings" that instruct the spring factory to make bean production, dependency injection, and bean instance distribution, which is one or more standard
Recent use of spring Boot+mybatis, using IntelliJ idea Development, to document some of the solution to the problem.
1, in the use of @mapper annotations instead of xxmapper.xml configuration files, using @select and other annotations to configure the SQL statement, how to configure the database field name to the JavaBean entity class properties of the automatic hump naming conversion.
With
How Spring loads xml configuration files: ApplicationContext
Everyone knows that Java reads common files through InputStream, OutStream, Reader, and Writer in Basic I/O. In the spring framework, how does it identify the xml configuration
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.