Eclipse中出现javax.servlet.ServletException: javax.servlet.jsp.JspTagException: ...500问题

今天尝试用jsp连接mysql数据库出现了报错.

具体报错:

网址报错:
Eclipse中出现javax.servlet.ServletException: javax.servlet.jsp.JspTagException: ...500问题
Type :Exception Report(异常报告)

Message: javax.servlet.ServletException: javax.servlet.jsp.JspTagException: In <driver>, invalid driver class name: “java.lang.ClassNotFoundException: com.mysql.jdbc.Driver”
(消息:javax.servlet.ServletException:javax.servlet.jsp.JspTagException:在&lt; driver&gt;中,驱动程序类名无效:“java.lang.ClassNotFoundException:com.mysql.jdbc.Driver”)

Description: The server encountered an unexpected condition that prevented it from fulfilling the request.(描述:服务器遇到意外情况,无法满足请求。)

控制台报错:
严重: Servlet.service() for servlet [jsp] in context with path [/TomcatTest] threw exception [javax.servlet.ServletException: javax.servlet.jsp.JspTagException: In <driver>, invalid driver class name: “java.lang.ClassNotFoundException: com.mysql.jdbc.Driver”] with root cause
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

解决的方法:

1.进入Tomcat包下的lib:

Eclipse中出现javax.servlet.ServletException: javax.servlet.jsp.JspTagException: ...500问题

2.找到你连接数据库的JDBC.jar包:
Eclipse中出现javax.servlet.ServletException: javax.servlet.jsp.JspTagException: ...500问题
3.将这个jar包放入Tomcat包下的lib目录下:
Eclipse中出现javax.servlet.ServletException: javax.servlet.jsp.JspTagException: ...500问题
4.重启我们的eclipse项目即可

成功解决问题!