Read about java spring framework tutorial for beginners, The latest news, videos, and discussion topics about java spring framework tutorial for beginners from alibabacloud.com
://blog.csdn.net/he90227/article/details/46309297Http://www.cnblogs.com/chenpi/p/6117090.htmlhttp://blog.csdn.net/ufo2910628/article/details/40399539Http://www.cnblogs.com/xd502djj/archive/2012/09/24/2700490.htmlIn summary, there are three main methods of centralized treatment(1) using the simple exception processor Simplemappingexceptionresolver provided by spring MVC;(2) Implement spring's exception handling interface (Handlerexceptionresolver) to c
In spring, how does one copy the attributes of an object?1) constructor2) inject values to attributes using the set method3) p namespace4) automatic configuration transfer (learn more, not recommended)5) annotation6) interfacePreparation (simulated business method) Action --> service --> dao1) UserDao:P 2) UserService:P 3) UserAction:4) App Test class:Public class App {ApplicationContext ac = new ClassPathXmlApplicationContext ("cn/itcast/propert
Use the Value property and the ref attribute of the
You can use
There are two situations (a) a direct collection of values and (b) passing a reference to a bean as one of the elements of the collection.
Example:we use the Eclipse IDE, and then follow these steps to create a spring application:
Here are the contents of the Javacollection.java file:
Package Com.yiibai;
Import java.util.*;
public class Javacollection {List addresslist;
1. How do you understand spring?
In particular, spring is a lightweight container for managing business-related objects. The core function is mainly: IOC,AOP,MVC.
IOD: Control reversal, the creation of the object to the container, so that the container to manage the life cycle of objects such as creation, initialization, destruction and so on.
AOP: Aspect-oriented programming, the focus of the modular, thro
While working with the database using normal old JDBC work, it becomes cumbersome to write unnecessary code to handle exceptions, open and close database connections, etc., but the spring JDBC framework requires all the low-level details from open connections, prepare and execute SQL statements, process exceptions, handle transactions, and finally close connections.
So all you have to do is define the conn
Preface: Starting from this blog I will continue to tell the Java Tutorial: SSH, the main content around the SSH framework analysis and construction, today, a brief introduction to SSH configuration. the SSH configuration sequence is: spring-->hibernate-->struts1. Build web-project and add
, it produces a result proxy class.8) Aspect (tangent): is a combination of pointcuts and notifications, which we need to write and configure.Ii. Introduction to AOPThe AOP we use is a third-party aspectj out. So they need to integrate their jar packages.1) Introduction of JAR Package (4 jar packages required).The following jar packages are required:1. Spring-aop-4.2.4.release.jar----The original jar package of AOP.2, Com.springsource.org.aopalliance-
of issuing transactions to use SQL databases is as follows:
Start a transaction using the BEGIN TRANSACTION command.
Use SQL queries to perform various deletions, updates, or inserts.
If all operations are successful, commit is performed, or all operations are rolled back.
The spring Framework provides a layer of abstraction above the different underlying transaction management APIs. Transaction suppor
Spring is an open-source, lightweight framework whose core is inversion of control (IOC) and aspect-oriented programming (AOP).As a business layer framework, spring is a good way to integrate the presentation layer with the persistence layer.IOC: Writes the creation and dependency of a class to a configuration file, al
Application.java1 Packagecom.example.spring;2 3 ImportOrg.springframework.context.support.AbstractApplicationContext;4 ImportOrg.springframework.context.support.ClassPathXmlApplicationContext;5 6 Public classApplication {7 Public Static voidMain (string[] args) {8 //Where the bean configuration file is located d:\\ideaprojects\\spring\\src\\beans.xml9 //using the Abstractapplicationcontext containerTenAbstractapplicationcontext
are as follows:· Bytype assembly by type you can find the type-matching bean in the container based on the property type, if there are more than one, an exception is thrown, and if not found, the property value is null;· ByName by name the bean with the same property name can be queried in the container based on the name of the property, and if not found, the property value is null;· constructor is similar to the bytype approach, where it is applied to the constructor parameter, and throws an e
even labeled @deprecated, which means they are deprecated, such as defaultannotationhandlermapping, annotation-methodhandlersolver do not require a default configuration. In addition Handlermapping, Andleradapter and Handlerexceptionresolver are configured more than one, in fact, View-resolver can have more than just the default configuration only one.The creation process of Dispatcherservlet is mainly to initialize the 9 large components, which are explained in detail after each component.Java
.publicclassNioSelectorClient {09.10./**11.* @author lihzh12.* @throws IOException13.* @alia OneCoder14.*/15.publicstaticvoidmain(String[] args)throwsIOException {16.SocketChannel channel = SocketChannel.open();17.channel.configureBlocking(false);18.channel.connect(newInetSocketAddress("127.0.0.1",8000));19.}20.}The code is simple, and after the server receives a connection request from the client, the "accept" message is printed.A simple summary is that the whole channel, channel plus a selecti
.
Easy to integrate-STRUTS2 integrates various integrations with other frameworks such as Spring,tiles and Sitemesh are now easier.
Template support-Supports build usage templates.
Plug-in support-improves core STRUTS2 features and enhances the use of plug-ins. A large number of plug-ins are available for Struts2.
Performance analysis-STRUTS2 analysis, debugging and analysis applications provide integration. In addition, struts provides in
What is the isolation of a transaction
Isolation is important for data consistency. Online has a lot of introduction, recommended reading: MySQL official website 14.5.2.1 Transaction isolation levels Hibernate Tutorial 20.7.2 Transaction the isolation Levels
In general, if you use read_uncommitted, which is appropriate for a read-only table, you do not have to wait to read the same item, but for a read-write table, if we read a data and then modify 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.