Jerry's Blog

Recording what I learned everyday

View on GitHub


12 May 2019

User Register

by Jerry Zhang

#Tip of the Day:



Metronic templates

Frontend templates website, but it is not free.

Project Architecture

StringUtils

Many libraries have a better implementation for a String operation. For example, they may check null before comparing two Strings.

Always check null to make your code robust

String check

For an web application, null and empty String are the same, which means the user did not input any information.

Register process should be in a transaction “@Transactional”

Validation must be done on both frontend and backend

Cross Origin

Must specify the scope of Cross Origin on both backend and frontend.

@CrossOrigin(allowCredentials = "true",allowedHeaders = "*")
xhrFields:{withCredentials:true}

MD5 encoding

Java’s embedded MD5 implementation only support 16-bit.

tags: Java, - Spring