Project scene:
The serialize() method is used to pass parameters in ajax, and the value received by the controller layer is inserted into the database.
Problem Description:
1. The parameter received by the controller layer is null
2. Cause: java.sql.SQLException: Data truncated for column'year' at row 1
Cause Analysis:
1. The name in the input tag does not correspond to the field in the Thesis class. (The commented out is wrong, the uncommented is correct)
2. The data accepted by the year field is too long and exceeds the byte range.
solution:
1. Modify the name attribute in the label in the input to be the same as the field in the Thesis class.
2. Expand the byte length that the year can hold