Spring Boot 2.X: Custom registration Servlet, Filter, Listener

Preface The web.xml file has been removed from Spring Boot. If you need to register and add Servlet, Filter and Listener as Spring Bean, there are two ways in Spring Boot: Annotation @ WebServlet, @ WebFilter, @Listener Used to configure. Spring Boot JavaConfig annotation is used to configure the Bean. Before registration When using Servlet, ...

Added by andrewtayloruk on Fri, 25 Oct 2019 03:58:18 +0300

springCloud - rely on Spring Security to implement stateless distributed sessions using JWT

case In the case of front-end and back-end microservices, the session is no longer suitable to be saved on the server side. Using redis can save the session, but it needs to be copied between redis clusters. If there are many users, the amount of data saved is also large. JWT is a solution to implement stateless session mechanism. 1. What is s ...

Added by inaba on Thu, 24 Oct 2019 09:24:57 +0300

Four ways of integrating websocket with spring boot

Four schemes of integrating websocket 1. Original notes pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> WebSocketConfig /* * * * * blog.coder4j.cn * * Copyright (C) 2016-2019 All Rights Reserved. * */ package cn. ...

Added by Riparian on Wed, 23 Oct 2019 21:29:53 +0300

Implementation of distributed Session

JWT Token Use JWT Token to store user identity, and then get other information from database or cache. In this way, it doesn't matter which server the request is assigned to. Tomcat + Redis Configure in tomcat's configuration file: <Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" /> <Manager classNam ...

Added by admun on Tue, 22 Oct 2019 00:15:56 +0300

Cookie overview and application of Java Web

What is Cookie Cookie technology is a solution to keep session tracking on the client side. II. Creation of Cookie object Cookies can be created through the constructor of the javax.servlet.http.Cookie class. Cookie cookie = new Cookie("username","Hum's blog"); The first parameter specifies the proper ...

Added by orlandinho on Sat, 19 Oct 2019 21:21:47 +0300

TensorFlow - understand tf.unstack(value, num=None, axis=0, name="unstack")

tf.unstack has appeared in the construction of cyclic neural network. It is convenient for you to record here. Function: split the input value according to the specified axis (dimension) (starting from 0), and output the list containing num elements. Num must be equal to the number of elements in the sp ...

Added by derrtyones on Thu, 17 Oct 2019 19:04:05 +0300

Summary of crawler's latest library requests HTML Library

Requests html is a relatively new crawler library. The author and requests are the same author. I. installation dependency pip install requests-html When installing, we can see that lxml,reuqests,bs4 are installed... Our common parsing and crawling libraries are installed in him separately. II. Request initiation from requests_html import HTMLS ...

Added by kwilder on Thu, 17 Oct 2019 12:58:13 +0300

What if my girlfriend asks to help her choose clothes?

I. analysis requirements If your girlfriend sends you a bunch of pictures of clothes, and then asks you which one looks good, you can only choose the one that looks best, what would you do? Why not leave it up to the process to make a choice? The theme of this article is to develop a selection program to solve your girlfriend's selection proble ...

Added by valoukh on Wed, 16 Oct 2019 13:17:48 +0300

ActiveMQ Learning Summary - Operational Operation 02

I believe you have a general idea of ActiveMQ through your last blog post. So this blog will lead you step by step to actually operate our ActiveMQ. The main contents of this paper are as follows: 1. Introduction of ActiveMQ Terminology and API 2.ActiveMQ Text Message Processing 3.ActiveMQ Object Message Processing Now that we have to le ...

Added by magic2goodil on Fri, 11 Oct 2019 16:47:26 +0300

Take you to know MySQL sys schema

Preface: A new sys schema is introduced in MySQL 5.7. Sys is a system library of MySQL. When MySQL 5.7 is installed and initialized with mysqld, sys library will be created automatically. The tables, views, functions and stored procedures in sys libraries can make it easier and faster for us to understand some information of MySQL, such as whic ...

Added by staggman on Fri, 11 Oct 2019 09:39:51 +0300