Cannot load JDBC driver class 'com.mysql.jdbc.Driver '错误的解决,超级坑

本篇为本人在springmvc开发实践中踩坑的实录,会不定时更新

1,springmvc返回视图时通过转发的方式进行,即request.getRequestDispatcher("/。。。.jsp").forward(request, response);这种方式,如果通过model.addAttribute("name",..)方式向jsp传参的话,发现在jsp中通过${name}得不到相应的值,而通过 request.setAttribute("name", 。。)这种方式设置的可以在jsp中通过${name}获取到值


2,No qualifying bean of type [。。。。。] found for dependency [com.。。。]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

这种错误一般是因为没有加注解的原因,比如@service


3,eclipse在运行项目之前需要先保存,不然会出现莫名其妙的问题,明明类中已经添加了相应的功能但就是报错,而intelliJ是自动保存的没有这个问题,其实eclipse是可以设置成运行前自动保存的,但需要手动设置一下


4,dataTable的使用过程中出现如下错误

DataTables warning: table id=dataTable - Requested unknown parameter ‘acceptId’极有可能的原因是该列的render函数没有返回数据

比方说if(){return data}elseif(){return data}这样的写法就容易造成方法没有返回值

5,在mybatis使用过程中There is no getter for property named 'userId' in 'class java.lang.Long'错误,其实应该加上@Param("userId")

6,intelij maven报错:unresoveled dependency,第一步先检查是否关闭了offline模式

7,intelij 建立java动态web工程https://www.cnblogs.com/jvpBlog/p/6519702.html

8,关于

Cannot load JDBC driver class 'com.mysql.jdbc.Driver '错误的解决,超级坑

http://blog.csdn.net/u013704227/article/details/46701441


9,关于错误not acceptable according to the request "accept" headers.的解决https://stackoverflow.com/questions/7462202/spring-json-request-getting-406-not-acceptable


猜你喜欢

转载自blog.csdn.net/jianjiankedizai/article/details/73741860