Previously exposed to XML-based configuration, spring,spring3.0 began to use pure Java code to configure spring applications with little or no XML. The steps for using spring based on Java configuration are as follows:1. Create a Java
Before learning spring, we can simulate a spring by ourselves based on the characteristics of spring. That is to say, we will not use spring to achieve the effect of spring. This example mainly implements the IOC function of spring
This section contains a brief introduction to:1. Spring boot configuration file, using @springbootapplication annotations2. Spring Boot modify Java version and project code3. A standard spring boot code structure4. View the current project automatically configured those modules5. Disable automatic configuration6. Custo
Java framework --- spring AOP implementation principle --- spring AOPWhat is AOP?
AOP (Aspect-OrientedProgramming) can be said to be a supplement and perfection of OOP (Object-Oriented Programing, object-oriented programming. OOP introduces concepts such as encapsulation, inheritance, and Polymorphism to establish an object hierarchy to simulate a set of public b
(restrictions), This causes the caller to fall into JPA code and, if materialized according to the specific scenario, may need to add code to many entity warehouses and not be universal. the role of Spring data
The warehouse code does not contain any business logic (in service), nor does it contain a UI (in controller), which is a generic boilerplate code. Spring data is a project that is independent of th
Spring is an open source framework, and spring is a lightweight Java development framework that emerged in 2003 by Rod Johnson in his book expert one-on-one development and Some of the concepts and prototypes elaborated in design are derived. It is created to address the complexities of enterprise application development. One of the main advantages of the framewo
Note: Because I am not accustomed to annotation way, so after the annotation here to achieve the basic configuration, after the annotation will not be taken out alone to explain.
V: Spring Annotation
1. Preparatory work(1) Import Common-annotations.jar(2) Import schema file file name is Spring-context-2.5.xsd(3) Configuring in the Beans node of XML
2.xml Configuration Work
Note: This configuration
code is formatted, comprehensive comments, beautiful and easy to read.11, detailed record system operation log, help the operation and maintenance personnel for system analysis and troubleshooting.12, using Ehcache two cache, Spring MVC static load cache and other mechanisms to improve system performance.13, the data persistence layer is divided into hibernate and MyBatis two big architectures. 2 sets of systems, in addition to the data persistence l
In real life, there are examples such as boiling water, generally burned for 20 minutes after the water, will need to change water, and then burn for 20 minutes, water opened again, continue to remind, such as work, every 8 o'clock in the morning alarm clock will be in time to remind, then in the Java program How to achieve this has been set the timing of the task? , the following describes the business requirements for how to implement timers to oper
Spring Boot creates beans using Java code and registers them to Spring.
From Spring3.0, a new method is added to configure Bean Definition, which is to configure Bean Definition through Java Code.The two configuration methods differ from Xml and Annotation:
The first two Xml and Annotation configuration methods are pre
To develop a feature based on spring, you need to add the development support environment for spring. The so-called spring support environment is to add the jar, TLD, and XML files needed for spring in a Java Web application, and with these files we can develop the
Spring Java Configuration 1, creating a MAVEN projectCreate a MAVEN project using idea, by the way, idea is really better than eclipse and familiar. Then MAVEN is the most mainstream of Java project management tools, first configure a try, very good to get started.2. Import DependencyEdit Pom File1, first configure the JDK version and code, two ways, according to
The previous presentation of spring's web version of Hello World, a demo of spring in a common Java project, with a discussion of Singleton and prototype, clearly sees spring's injection strategy for entities.
Since it was a demo, it was added to a simple Beanpostprocessorimpl implementation class after looking at the factory's processor and the Bean's front and back processor.
Project structure:
After bui
1. Java JDK and Tomcat installationI am installing JDK 1.8 and Tomcat 8 here, as described in the installation steps: http://www.cnblogs.com/eczhou/p/6285248.html2. Download Eclipse and installI am installing the Java EE Neon 64-bit version here.3. Build the Spring MVC Project3.1. Open the installed Eclipse and select File->new->other. Select Web->dynamic Web Pro
, which provides transaction management for a single javax.sql.DataSource transaction management, SPRINGJDBC abstract framework, Ibatis framework ;
Hibernatetransactionmanager : In the Org.springframework.orm.hibernate3 or HIBERNATE4 package, provides transaction management support for a single org.hibernate.SessionFactory transaction when integrating the Hibernate framework, which only supports hibernate3+ version, and the spring3.0+ version only supports hibernate3.2+ version;
Jtatrans
First, let's take a look at some of the conceptual terms that the official document gives us about AOP:
Slice (Aspect): A modular focus that may cross multiple objects. Transaction management is a good example of crosscutting concerns in Java application. In spring AOP, slices can be implemented using patterns or based on aspect annotations. The popular point is that we add the slice class (such as Log Clas
20 Java-based spring annotation configuration (for some examples of annotations)Java-based configuration allows you to do most of your spring configuration, rather than through an XML file, with the help of a small number of Java annotations.As an example of @configuration a
Simplifying the Java development of Spring 1.1 introductionIn order to reduce the complexity of Java development,Spring has adopted the following 4 key strategies to simplify the javabean of features that differ from EJB:
Pojo-based lightweight and minimally invasive programming
Loose coupling via Dependen
Spring provides two types of transaction management: programmatic and declarative. Programming, flexible, but with a large amount of code, there are more repeated code; declarative is more flexible than programming. The main programming method is transactionTemplate. Some commit, rollback, and a series of transaction object definitions are omitted, which need to be injected into the transaction management object. Declarative: mainly uses TransactionPr
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.