When a new numeric field is added, the database default field value is null. This way, when a page with this field is accessed, a null pointer error is reported.
For example:
critical [http-nio-80-exec-11] Org.apache.catalina.core.ApplicationDispatcher.invoke servlet.service () for Servlet JSP threw exception
Solution:
此种错误是由于jsp页面获得了一个空指针导致,即servlet传参数时有一个参数没穿过去或者传的参数和接受的参数不一致导致的,检查一下参数即可解决
I found out my mistake was that the value in the numeric field database is null and can only be manually changed to 0.br/> when the new field is first compiled run, on the Entity class new field, plus * * @Column annotations to identify the corresponding relationship between the attribute in the entity class and the field in the data table * *
@Column(name = "zyControlSec", columnDefinition = "int not NULL DEFAULT ((0)) ")
Database new numeric field, initializing @Column annotations