[Solved] servlet jump to Blank Page Error: java.lang.ClassNotFoundException: com.mysql.jdbc.

The problem of page blank after servlet jump

Servlet code

report errors

ava.lang.ClassNotFoundException: com.mysql.jdbc.Driver exception

Reason: it has nothing to do with the above code,

The real reason is that the MySQL jar package was not imported into Tomcat. His grandmother found this problem for a long time and almost died

Now let’s show a wave of operation

1. Open Tomcat configuration,

2. Enter the favorite Guide Package link

Everyone’s lib directory is stored in different locations here. Anyway, you need to import the MySQL package into the Lib directory,

If you find that you don’t have this package, we’ll copy and paste it online or copy it in the Maven project

The main reason is that the MySQL package is not imported into tomcat, which leads to such an error

Similar Posts: