Discover spring fragrance summary, include the articles, news, trends, analysis and practical advice about spring fragrance summary on alibabacloud.com
, although the benefits of a lot, but access to each interface should be broken by the interface, if the processing logic is different okay, no difference I will not say. Since we are unified return, the use of global exceptions to intercept log returns failed for a problem, there is a disadvantage that access to the exception can be handled, as for timeouts these are not access to capture.discussion The Apprentice is not fine, some are indefinitely, hope the great God can guide pointing. It's a
Spring/spring boot/spring cloud Development Summary, springcloud
Background
Dubbo and dubbox are used for remote RPC calls. As the community suspends maintenance and responds to future development, we are ready to try new technologies (maybe not a new technology at this time) and choose to use the
code:@SpringBootConfiguration @enableautoconfiguration@componentscanThese three parameters are important parameters:@SpringBootConfiguration indicates that this is a configuration,@EnableAutoConfiguration indicates that spring boot is automatically configured for the current project based on the jar package dependencies in the classpath.For example, by adding the base dependency of Spring-boot-starter-web,
: Execution handler complete execution of this method, application scenario: Unified exception handling, unified log processing2). Interceptor Configuration:A. For handlermapping configuration (not recommended): The SPRINGMVC Interceptor is set for handlermapping, and if blocking is configured in a handlermapping, the Handlermapping Mapping the successful handlerThe interceptor is eventually used. (generally not recommended)B. A global-like interceptor: SPRINGMVC is configured like a global inte
[Interview] [Spring FAQ summary] [01], spring FAQ 01Spring is an open-source framework. Spring was a lightweight Java development framework that emerged in 2003, it is derived from part of the concepts and prototype stated by Rod Johnson in his book "Expert One-On-One J2EE Development and Design. It is created to solve
operations.Spring Cloud Data Flow: The Big data manipulation tool that operates data streams from the command line.Spring Cloud Security: Safety Toolkit, which adds security controls to your application, mainly refers to OAuth2.Spring Cloud Consul: Encapsulates the Consul operation, Consul is a service discovery and configuration tool that can be seamlessly integrated with Docker containers.Spring Cloud Zookeeper: A toolkit for manipulating Zookeeper
class.In the latter parent-child mode, Spring uses the Cglib library to generate a subclass of the target class, and when the subclass is created, spring weaves the notification and delegates the call to the subclass to the target class.In contrast, the brother mode is better, he can be more loosely coupled, especially in today's shouting interface-oriented programming situation, the parent-child mode is o
, this principle is because our Customerdao inherited Jdbcdaosupport, Here we will look at its source code:First we use This.getjdbctemplate to obtain a JdbcTemplate instance: 1/**
2 * Return the JdbcTemplate for this DAO,
3 * pre-initialized with the DataSource or set explicitly.
4 *
/5 Public final JdbcTemplate getjdbctemplate () {
6 return this.jdbctemplate;
7} Is it worthwhile to return this this.jdbctemplate? Look at the source code is the original when we setdatasource generated Jdb
: Execution handler complete execution of this method, application scenario: Unified exception handling, unified log processing2). Interceptor Configuration:A. For handlermapping configuration (not recommended): The SPRINGMVC Interceptor is set for handlermapping, and if blocking is configured in a handlermapping, the Handlermapping Mapping the successful handlerThe interceptor is eventually used. (generally not recommended)B. A global-like interceptor: SPRINGMVC is configured like a global inte
handlerexecutionchain This execution chain (execution chain), the next process will be expanded around it. At this point, the entire execution of the Handlerexecutionchain is clear: before actually invoking its handler object, an array of Handlerinterceptor interface implementation classes will be traversed, and the Prehandle method will be called sequentially. Then the real handler object will be called.Summary : The main content here is the registration and acquisition of the two processes, a
Module
Summary
Let's now examine the functionality that spring offers inMore detail. It is divided into a number of separate modules.
There are two main categories of functionality in Spring:
An IOC container and AOP framework, which handleConfiguration and application of services to objects.
A set of services that can be applied to ApplicationObjec
Spring MVC learning summary and springmvc learning Summary(1) Spring MVC is an MVC framework. I personally think that Spring MVC annotation-based development is more convenient than Struts2, and can directly replace Struts above (of course, Struts is a very mature MVC, the f
Aspectj weaving point Syntax:
1. execution (public ** (..) any method of any return value of any class
2. execution (* set * (..) method starting with set of any class
3. execution (* com. xyz. service. AccountService. * (..) specifies the methods in the class for any returned values
4. If execution (* com. xyz. service... *. * (...) returns any value, specify any class or method of the package
Advise summary. Example:
1. Example: directly specify the
ISOLATION level Dirty read non-repeatable read Phantom read
Read_uncommited y y
read_commited N y y
Repeatable_read N N Y
SERIALIZABLE n n N
Two, spring transaction usage
1, XML configuration (handling summary from the open-Tao great God)
The core of class= "Org.springframework.orm.hibernate3.HibernateTransactionManager" >
Name: Defines the method name associated with the transaction property
declarative transaction management of spring management is implemented by:
A transaction is declared in the server layer:
public void Inserall ()
{for
(int i=0;i
Test Type tests:
public void Inserall ()
{for
(int i=0;i
The third kind, splicing to insert:
To create a stitched statement:
Mapper.xml file:
Two data: One copy 50, one copy 20000:
Final result test:
Declaring a transactional link string manual
50 article 20,0
+ @EnableAutoConfiguration + @ComponentScan . @RestController annotations are equivalent to @responsebody + @Controller combined@Configuration: This is a configuration class that configures spring.@Controller: Indicate that this is a SPRINGMVC controller. @ResponseBody: If you need to return Json,xml or customize mediatype content to the page, You need to add the @responsebody annotation to the corresponding method Main method: Launches an a
In the learning spring process encountered a variety of unusual errors, here to do a summary, hoping to meet similar mistakes students to share.
1. Error One
Error creating Bean with Name ' Helloserviceimpl ' defined in class path resource [Spring-service.xml]: Error setting proper Ty values; Nested exception is Org.springframework.beans.NotWritablePropertyExce
container is a standalone module that cannot be used directly in a Web container. So you need to design a process to start and initialize the IOC container. Look at the following configuration file: The two configuration items listener Configure a listener to listen for the Web container's startup and then trigger the spring IOC to load into the Web container. The servlet configuration item is configured with the main distributor of
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.