Project knowledge blind area sorting 4

Posted by mrmitch on Tue, 07 Dec 2021 14:20:45 +0100

Project knowledge blind area sorting 4

Collection of common rich text compilers

1.UEditor

UEditor

2.wangEditor

wangEditor

3.summernote

summernote

Common chart plug-ins

ECharts

ECharts

Common font plug-ins

fontawesome

fontawesome

Verification Code

kaptcha

kaptcha

element

Element

jwt

Springboot 2.0 - integrating JWT to implement token verification

Play with the integrated JWT of SpringBoot 2 Part I

Spring boot integrates JWT

[SpringBoot] 44. Integrating JWT in SpringBoot to realize Token verification (integration)

[SpringBoot] 45. Integrate JWT into SpringBoot to realize Token verification (annotation)

Cross domain – origin request header

referrer:

adopt window.location.href Get address attached to referrer To prevent stealing links and malicious requests

Origin:

have referrer For cross domain operations, the standard browser will carry this request header field as long as it is cross domain,
If the background allows the address of this field, the request is normal. If not, the browser will abort,No event occurs, as if no request had been made, network I can't see it

This header must be added to the Origin cross domain access of HTTP Headers

The non Controller layer obtains HttpServletRequest and HttpServletResponse through RequestContextHolder.getRequestAttributes()

@Component
public class SpringContextUtils implements ApplicationContextAware {

    /**
     * Context object instance
     */
    private static ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        SpringContextUtils.applicationContext = applicationContext;
    }

    /**
     * Get applicationContext
     *
     * @return
     */
    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    /**
     * Get HttpServletRequest
     */
    public static HttpServletRequest getHttpServletRequest() {
        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
    }

    //Get domain name
    public static String getDomain() {
        HttpServletRequest request = getHttpServletRequest();
        StringBuffer url = request.getRequestURL();
        return url.delete(url.length() - request.getRequestURI().length(), url.length()).toString();
    }

    //Is it a cross domain request
    public static String getOrigin() {
        HttpServletRequest request = getHttpServletRequest();
        return request.getHeader("Origin");
    }
}

The non Controller layer obtains HttpServletRequest and httpservletresponse null pointers through RequestContextHolder.getRequestAttributes()

Interceptor HandlerInterceptorAdapter usage method

Interceptor HandlerInterceptorAdapter usage method

The Body returned when the interceptor is set to false

Spring Boot notes - the Body returned when the interceptor is set to false The springboot interceptor handles requests that return false

@Introduction and three usages of ControllerAdvice

@Introduction and three usages of ControllerAdvice

Naocs: Error creating bean with name 'configurationPropertiesBeans' defined in class path resource exception analysis

Error creating bean with name 'configurationPropertiesBeans' defined in class path resource exception analysis

Redis template operation

redistemplate usage

RedisTemplate common methods (super detailed)

Redis set password login

How redis sets the password

Redis configuration password and login

#Redis server address
spring.redis.host=101.132.74.181
#Redis server connection port
spring.redis.port=6379
#Redis database index (0 by default)
spring.redis.database= 0
#Connection timeout (MS)
spring.redis.timeout=1800000
#Maximum number of connections in the connection pool (negative value indicates no limit)
spring.redis.lettuce.pool.max-active=20
#Maximum blocking waiting time (negative number indicates no limit)
spring.redis.lettuce.pool.max-wait=-1
#Maximum free connections in the connection pool
spring.redis.lettuce.pool.max-idle=5
#Minimum free connections in connection pool
spring.redis.lettuce.pool.min-idle=0
#Password for redis connection
spring.redis.password=126433zdh

Automatic humping occurs when some fields are null when using mybatis plus query

When we use mybatis plus, mybatis plus can help us automatically encapsulate our entity class for query and addition. When we meet that our entity class name and our table fields are written in Hump:

For example, a field in the entity class is userName, and our field name in the database is also userName

The default hump code will be written as user by default in mybatis plus_ Name, an underlined field

At this time, you will find that your code will make an error, and it will prompt you user_ The name field is null

Solution: set and turn off hump coding in application.yml

mybatis-plus:

  configuration:

    map-underscore-to-camel-case: false

org.thymeleaf.exceptions.TemplateInputException: Error resolving template [topic/get_all_topics], template might not exist or might not be accessible by any of the configured Template Resolvers

reason:

The page Jump is required to be returned, but the json data is returned

The difference between context path and servlet path and the role of distribution in nginx

Configuration of SpringBoot server.servlet-path and server.context-path

The role of server.context-path in Spring Boot applications

Path problem in web project

Path problem in web project

redis command

redis Command Reference

Three strategies for deleting expired keys in Redis

Three strategies for deleting expired keys in Redis