Play wechat everyday, Spring Boot develops private instant messaging system

1/ overview Using Spring Boot as the basic framework, Spring Security as the security framework and WebSocket as the communication framework, point-to-point chat and group chat are realized. 2 / dependence required Spring Boot version 1.5.3 uses MongoDB to store data (not required). Maven relies on the following: <properties> <java ...

Posted on Sat, 09 Nov 2019 04:49:06 -0500 by yong

How to verify the form input in the server for the Web project built by Spring Boot

This article first appeared on personal website: How to verify the form input in the server for the Web project built by Spring Boot This example is used to demonstrate how to verify the input of the Web application in the Spring Boot application. We will build a simple Spring MVC application to read the user's input and use the validation an ...

Posted on Mon, 28 Oct 2019 12:39:25 -0400 by littlegreenman

Spring Boot 2.X: Global exception handling

Preface In Java Web system development, whether it is the Controller layer, Service layer or Dao layer, it is possible to throw exceptions. If you add the exception handling code of various try catch in each method, it will make the code very tedious. In Spring MVC, we can decouple all types of exception handling from each individual method, an ...

Posted on Sat, 26 Oct 2019 02:52:01 -0400 by rbragg

Spring Boot 2 + Thymeleaf: server side form validation

Form validation is divided into front-end validation and server-side validation.In terms of server-side verification, Java provides JSR 303 specification which is mainly used for data verification, while Hibernate Validator implements JSR 303 specification.When project dependency is added to spring boot starter thymeleaf, Hibernate Validator de ...

Posted on Mon, 21 Oct 2019 14:11:43 -0400 by MindOverBody

Tymeleaf common syntax: template comments

Tymeleaf template annotation can be divided into standard HTML/XML annotation, parsing layer annotation and prototype annotation. I. notes 1. Standard HTML/XML comments It is opened directly through the browser without display, and the template engine of Thymeleaf does not process the parsing, but the source code of the web page is viewed an ...

Posted on Sat, 19 Oct 2019 10:05:04 -0400 by Lateuk

Tymeleaf common syntax: data delay loading

When processing a template, it is up to the template logic to decide whether to load the data to improve performance.When setting data in the Spring Boot controller, you can use LazyContextVariable to do this. Development environment: IntelliJ idea February 2, 2019Spring Boot version: 2.1.8 Create a new Spring Boot project named demo. 1,pom. ...

Posted on Fri, 18 Oct 2019 14:29:25 -0400 by acidHL

Common syntax of Thymeleaf: conditional judgment if, switch case

if statementConditional judgment uses th:if, which determines whether the expression is valid. The result of the expression supports boolean, number, character, String and other types.The if statement is true if:(1) the result of the expression is a number and not 0(2) the result of the expression is a string and not false, off, no, 0(3) the re ...

Posted on Thu, 17 Oct 2019 16:56:47 -0400 by jamesdk

Tymeleaf common syntax: Data iteration

Thymeleaf data iteration uses th:each attribute, which can iterate array, List, Set and Map. The iteration methods of array, List and Set are similar. Iterate Map and you will get a java.util.Map.Entry object.In the process of iteration, we can also get the variables of iteration state, such as iteration index, data set size and so on. Develop ...

Posted on Thu, 17 Oct 2019 15:50:35 -0400 by oscardog

Use of Thymeleaf objects: basic objects

Thymeleaf has many built-in objects that can implement various functions in templates.There are several basic objects below.Web objects are commonly used: request, session, servletContext.Thymeleaf provides several built-in variables, param, session, and application, which can access request parameters, session attributes, and application attri ...

Posted on Fri, 11 Oct 2019 14:10:20 -0400 by djremiasz

SpringBoot 2.0 Basic Case (14): File upload logic based on Yml configuration

I. Document upload File upload is a very common function in project development, such as head image upload, all kinds of document data upload and so on. SpringBoot uses MultiPartFile to receive files from forms and then execute uploads. This case is based on the yml configuration in SpringBoot 2.0, which manages the common attributes of file up ...

Posted on Sun, 06 Oct 2019 00:22:18 -0400 by Alelinux