具体实现步骤及代码:https://blog.csdn.net/zxw136511485/article/details/52584497
遇到的坑如下
记得修改XML中的base-package报错:
Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#1' defined in ServletContext resource [/WEB-INF/rest-spring.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonProcessingException
解决方案:
spring和jackson版本不匹配,升级jackson后不再报此问题
报错:
org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [StudentInq] in context with path [/springmvcdemo] threw exception
java.lang.NullPointerException
解决方案:
1. 仔细检查链接数据库各参数是否正确,包括是否有多余空格
2. 将sql的jar包放到web/WEB-INF/lib里,这样编译后,WEB端可引用
网友评论