Introduction
Objective: To solve the complexity of enterprise application development
Function: Use basic JavaBean instead of EJB, and provide more enterprise application function
Scope: Any Java application
The Spring framework is a layered architecture consisting of 7 well-defined modules. The Spring module is built on top of the core cont
Spring framework study notes 3: Use annotations instead of configuration files, spring Study Notes
1. Import context constraint: spring-context-4.2.xsd
2. Open the xml configuration file in design mode, right-click edit namespaces, and click add to add
After completion, it should be like this:
In the configurati
, the spring framework can standardize many of the best practices of Java EE, as well as homogenize many ubiquitous Java EE patterns. Next, we'll look at a small part of spring's huge system, focusing on (in my humble opinion) the ability to help improve the functionality of the Java EE application.
Introduction to the IOC
In general, IOC is a technology that manages the association between classes. Yes, it
Pom.xml file, the required configuration can be obtained from the official website, please do not Baidu configuration, boring!!! There are two ways to obtain: 1.maven Central warehouse: http://mvnrepository.com/?? 2.spring official website: http://projects.spring.io/spring-framework/. Which, in spring, gets the simple
An overview of AOP theoryAspect oriented programming programming for facetsIndustry AOP is actually an extension of OOP (object-oriented programming)-OOP programming language, AOP design ideaAOP takes the horizontal extraction mechanism instead of the traditional vertical inheritance system repetitive code ( performance monitoring, transaction management, security check, caching )Horizontal extraction of code reuse, based on agent technology, without modification of the original object code, the
Download the homepage http://www.springframework.org/download.html, or use the link address directly: http://voxel.dl.sourceforge.net/sourceforge/ Springframework/spring-framework-1.1.4-with-dependencies.zip
Spring's download package has two kinds: spring-
Spring official website After the revision, the proposal is through maven and gradle download, for not using maven and Gradle development projects, download is very troublesome, give the spring Framework Jar official Direct Download
Pick up Spring Framework Learning Note (iii) declarative Transaction management (XML configuration)1 configuration file mode using AOP idea configurationThe first step is to configure the transaction managerSecond step to configure transaction enhancementsStep three Configure FacetsDeclarative transaction management (annotations)The first step is to configure the transaction managerSecond step to configure
1. To simplify JUnit testing, the spring framework can also be used to integrate testing2. Specific stepsRequirement: There must be a junit environment first (that is, a development environment that has been imported into the JUNIT4)Step one: Introduce Spring-test.jar in the programStep Two: Add annotations on the specific test class
@RunWith (Springjunit4classru
From the Internet to find some methods, and now all tidy up, there are simple rough, there are also the ileum (detailed, directly from the official website step by step into the download page), I hope you can find the true love according to their own preferences.Method One: (Simple rough direct)http://repo.springsource.org/libs-release-local/org/springframework/spring/3.2.4.RELEASE/
This article focuses on the use of annotations in the Java Spring Framework, including a description of the Java bean definition, and the friends you need can refer to the
1. Using spring annotations to inject properties
1.1. How we injected attributes before using annotationsImplementation of the class:?
1 2 3 4 5 6 7
Class Usermanagerimpl impl
User (Username,password) VALUES (?,?)", user.getusername (), User.getpassword ());} Named parameter public void AddUser (user user) { mapThe following example shows the process of reading data from a database. Where RowMapper's role is to convert a row of data into an object.Public listTransactionThe transaction in spring is managed by a specialized class named TransactionManager. The following bean configurations are required.After
This article is an introduction to file upload, because in spring MVC and directly in the servlet to write a little different, so specifically wrote this article, about the difference, you can read the previous article. OK, here's the code directly.
Jab package is Jspsmartupload.jar, if there is similar jar package such as: commons-fileupload-1.2.2, leave a can, otherwise will conflict the error
First is a simple page (JSP), more ugly, but can be used
analyzed, really need us to write code only Multidatasource, spobserver two classes. The Multidatasource class really writes only the Getdatasource () and Getdatasource (SP) two methods, and the Spobserver class is simpler. The simpler the implementation, the less likely the error will be, and the higher the maintainability will be.Finally, this scheme enables single data sources to be compatible with multiple data sources. This scheme does not affect the programming of bus and DAO at all. If o
framework provided by Ibatis includes SQL maps and Data Access Objects (DAO) MyBatis eliminates the manual setting of almost all JDBC code and parameters and the retrieval of result sets. MyBatis uses simple XML or annotations for configuration and raw mapping, mapping interfaces and Java POJOs (Plain old Java Objects, ordinary Java objects) to records in a database.
2. Construction of development environment
If necessary, see the previous blog p
I. Introduction to SPRINGSpring is an open source framework that is created to address the complexities of enterprise application development. One of the main advantages of the framework is its layered architecture, which allows you to choose which components to use while providing an integrated framework for Java EE application development.
Description: The following is a version of the official spring document, 4.3. Version 11.I. Citation of official documents2.2.1 Core ContainerThe core container consists of the following parts,,, spring-core spring-beans spring-context spring-context-support and
As the first part of this series that introduces aspect-oriented programming in the Spring Framework (aspect-oriented PROGRAMMING,AOP), this article describes the basics of enabling you to use aspect-oriented features in spring for rapid development. Using the tracking and logging aspects (aspect-oriented HelloWorld) as an example, this article demonstrates how t
learning Java I will, if you do not, that can be really sad.
1. After you create a project in MyEclipse, you can configure a Spring project in the chosen way, which is not discussed here. Because I only use Eclipse.
2. Build manually. Just do it. Create a new Java Web project
1. Open Eclipse, right-click under the Project Explorer tab and choose Web-dynamic Web prodect (This step should know ...) )。
2. Click Next. Start a project that you think is a
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.