Policy mode and using Spring to implement Policy mode + Factory mode
1. Strategic Model
A policy pattern defines a set of algorithms that encapsulate each one and make them interchangeable
1. Primary Role of Policy Patterns
The main roles are as follows:
Encapsulation role (Context): Also known as context role, it acts as a connecting link between encapsulation and ...
Posted by kane007 on Thu, 30 Jan 2020 18:01:44 -0800
SpringMVC Annotation Configuration
Configuring spring mvc with annotations
(1) configuration file for spring mvc
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="htt ...
Posted by pwes24 on Thu, 30 Jan 2020 17:43:35 -0800
SpringBoot 2 Actuator Build RESTful Web Service
Opening Word
Spring Boot Actuator Is a subproject of Spring Boot.It adds several production-level services to your application, which don't require much effort from you.In this guide, you will build an application that adds these services.
Applications you will create
This guide will guide you in ...
Posted by mdemetri2 on Thu, 30 Jan 2020 17:11:47 -0800
Spring 5 Learning Series 3 register components 3 @ Conditional and @ Import annotation usage
The previous article mainly introduced two methods of @ bean @ ComponentScan package scanning injection. Today, I will introduce the related usage of @ Conditional injection and @ import component import
1. First, the usage of @ Conditional: judge according to certain conditions, register the beans ...
Posted by gkelley091565 on Thu, 30 Jan 2020 00:32:38 -0800
Spring MVC self study log 04 (Controller and RestFul style)
Controller
Controller complex provides the behavior of accessing application program, which is usually realized by two methods of interface definition or annotation definition.
The controller is responsible for parsing the user's request and converting it into a model.
In Spring MVC, a controller cla ...
Posted by googlehunter on Wed, 29 Jan 2020 19:19:03 -0800
Start and call of Spring Boot
[eye]
1. A way to start Spring BootService startup class
package com.npc.rest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
/**
* Frozen
* 2020-1-29
*/
/**
* Previously, users used three annotations to ...
Posted by blakey on Wed, 29 Jan 2020 07:39:19 -0800
Spring datajpa series 02 - add, delete, modify and query (based on springboot2.0.3+MySQL5.7)
Reprint please indicate Original: https://me.csdn.net/jxysgzs
1, Necessary foreword
We learned about the basic use of spring datajpa through the previous article. In this article, we will explain the basic addition, deletion, modification and query. After all, CURD operation is essential for every p ...
Posted by melmoth on Wed, 29 Jan 2020 04:22:54 -0800
Using enumeration in Java well, it's not so simple!
Recently, I revisited Java enumeration and saw this article that I thought was good, so I simply translated and improved some content and shared it with you. I hope you can also get something. In addition, don't forget that there is a supplement at the end of the article!
ps: here is an enumeration article, which is also a very practical pract ...
Posted by habib009pk on Wed, 29 Jan 2020 00:19:07 -0800
The AOP operation of Spring's aspectj
AOP concepts
1 aop: Aspect oriented programming, extensions do not modify the source code implementation.
2 aop takes the horizontal extraction mechanism instead of the traditional vertical inheritance system duplicate code.
3 aop underlying implementation using dynamic proxy
(1) In t ...
Posted by fiddlehead_cons on Tue, 28 Jan 2020 17:45:25 -0800
Spring AOP-01 pre enhanced MethodBeforeAdvice
1. Classes to enhance
package com.test.springadvicetype;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Attendants
*/
@Component
public class Waiter {
/**
* service
* @param name
*/
public String serve(String name) {
System.ou ...
Posted by Emperio on Tue, 28 Jan 2020 07:50:07 -0800