This error often occurs during the completion of the Javaweb project.
500: Refers to server internal error
I usually encounter this situation, I will go to see the console information, there will certainly be hints, null pointers (values are not passed), or java.sql.SQLException, in the interface and DAO
Check it out and you'll find out where the problem lies.
You can insert some test statements in the middle, gradually narrowing down the scope, you can find out where the error occurred in the step.
The possibility of an error
Use for loop to make objects cross-border access
For example:
//若只有5个元素,当访问到第6个了,就属于越界访问,就会报错
for(i = 0;i<10;i++)
Student stu = dao.load(i);
- Database problems, no connection, or unreadable data, causing some variables to be empty
- The name of the variable being sent is inconsistent with the variable name received
Problem Resolution--http Status 500