Tag:springboot

  • AOP facet gets the class annotation above the inherited tkmapper subclass

    Time:2020-4-2

    This is the first article I wrote. I am still a little white. I can point out the mistakes1. Pointcut expression: execution is used to match the connection point; annotation can only match the annotation on the method, but the annotation on the class cannot. @annotation(com.novacloud.common.annotation.MongoJournal) execution(* com.novacloud.common.dao..*.*(..)) 2. Around is the first to be […]

  • Spring security: how to protect user password

    Time:2020-4-1

    1. Preface In the previous article (https://www.felord.cn), we discussed the important user information subjects in spring securityUserDetailsIt is discussed. In the middle example, we use clear text password, and the rule is to add clear text to the password{noop}Prefix. Then this section will discuss the password encoding in spring security. 2. MD5 is not recommended […]

  • Using docker to quickly deploy elk and connect with springboot

    Time:2020-3-31

    Using docker to quickly deploy elk 1. Introduction to software & Tools Elk is the abbreviation of three open source software, which respectively means: elastic search, logstash, kibana, they are all open source software. A new filebeat is added, which is a lightweight log collection and processing tool (agent). Filebeat takes up less resources and […]

  • Global exception handling in the web part of spring boot series

    Time:2020-3-30

    When there are exceptions in our back-end applications, we usually wrap the exceptions and return them to the caller or the front-end. In the actual project, it is impossible to handle exceptions in every place, and even elegant code may throw exceptions. How can we handle these exceptions gracefully in the spring project? This paper […]

  • Spring boot tour of PHP program ape

    Time:2020-3-29

    In the previous section, spring boot has been used to implement a restful API, but the data interaction is realized through map. In this section, we use JPA to interact with the database. After the completion of this section, we can implement a more complex demo in combination with the previous demo. Add dependency <dependency> […]

  • Spring boot 2: mock test your web application

    Time:2020-3-28

    1. outline Software testing is a guarantee of application software quality. Java developers often neglect interface unit testing. As a java development, if you can mock unit tests, your bug amount will be greatly reduced. Spring provides the test module, so now little brother Pang will take you to play the mock unit test under […]

  • Spring boot 2: integrating mapstructure type conversion artifact

    Time:2020-3-27

    1. pain spot The emergence of a framework needs to solve a pain point. I think the following inconvenient operations are often written by someone.IfCarClass is a database mapping class:​​ package cn.felord.mapstruct.entity; import lombok.Data; /** * Car * * @author Felordcn * @since 13:35 2019/10/12 **/ @Data public class Car { private String make; private […]

  • Spring extension point: beanfactorypostprocessor and its sub interface

    Time:2020-3-25

    BeanFactoryPostProcessor BeanFactoryPostProcessorIt is a functional interface with only one method: @FunctionalInterface public interface BeanFactoryPostProcessor { void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException; } Take a look at the description on the doc document: Allows for custom modification of an application context’s bean definitions, adapting the bean property values of the context’s underlying bean factory. Application contexts can […]

  • Spring security (5) – perfect rights management system (authorization process analysis)

    Time:2020-3-23

    1. Relevant concepts of authority management Permission management is an important part of almost all background systems, and its main purpose is to control the permission of the whole background management system. Common role-based access control, whose authorization model is“User role permission”In short, a user has multiple roles and a role has multiple permissions. Among […]

  • Spring boot interview questions

    Time:2020-3-22

    1. introduction Since the birth of spring boot, it has caused a sensation in the industry. At present, more and more companies choose to embrace spring boot for technology selection. So spring boot has become one of the questions that must be asked in an interview. Then little fatty summed up some ideas to broaden […]

  • Spring boot (12): spring boot mail service

    Time:2020-3-21

    The first time we used JavaMail to send email, and in spring boot, spring boot helps us encapsulate JavaMail, which can be used directly. 1. Dependency file pom.xml Code listing: spring boot mail / pom.xml <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> Spring boot starter thymeleaf introduced […]

  • Spring security in action: a preliminary study on automatic configuration of spring security in spring boot

    Time:2020-3-20

    1. Preface We discussed the user information management mechanism and password mechanism of spring security in the previous articles. We foundSpring Security StarterDependentServletAuto configuration is all inspring-boot-autoconfigure-2.1.9.RELEASE(the current spring boot version is2.1.9.RELEASE)Path to moduleorg.springframework.boot.autoconfigure.security.servletBelow. In fact, you can automatically configure the starter components provided by the government in thespring-boot-autoconfigure-2.1.9.RELEASEFind it below. Today we’re going to […]