1、安装oracle驱动依赖;
解决:https://blog.csdn.net/hu_mingwei/article/details/118492631
2、pom.xml没有提示
3、controller与前端的参数对应不上
解决:前段form的input使用name而不是id与controller形参对应
4、form登录使用action和submit方式提交用户名密码给对应的controller,This application has no explicit mapping for /error, so you are seeing this as a fallback.,There was an unexpected error (type=Method Not Allowed, status=405).
原因:
5:jquery官网下载,点击下载链接是js网页
进入代码页面后需要ctrl+s
6、将项目转化为angularJS项目或JS项目(configure->convert to angularJS/javascript project)后如何撤销?
解决:properties->project natures->选择remove
这篇写的很好:https://blog.csdn.net/jerry741/article/details/103460033?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-3.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-3.control
7、依赖在https://mvnrepository.com/里找
8、window.location.href跳转出现重复路径
解决:因为window.location.href是当前页面打开URL页面
9、form和ajax重复提交
在
.
a
j
a
x
(
)
后
面
r
e
t
u
r
n
f
a
l
s
e
10
、
a
j
a
x
传
j
s
o
n
到
c
o
n
t
r
o
l
l
e
r
为
n
u
l
l
解
决
:
.ajax({})后面return false 10、ajax传json到controller为null 解决:
.ajax()后面returnfalse10、ajax传json到controller为null解决:.ajax({
url : “/east/index”,
type : “post”,
data:{
username : username,
password : password
},
@RequestMapping(“/index”)
@ResponseBody
public RespObject index(String username,String password) {
11、ajax中if()中也是==,仅用一个=会改变值而不正常判断
12、jquery设置span的文本用$().text(“文本”)
13、阻止用户未登录非法访问网页,使用拦截器还是过滤器
14、列表用ol、li,行表用table、tr、th(表头)、td
15、vue方法内不能用ajax,应该用axios,且返回的数据在response.data里
axios
.get(‘/项目名/MappingValue’)
.then(response => (this.sjqrs = response.data.result))
.catch(function (error) { // 请求失败处理
console.log(error);
});
16、
注意新建html文件时默认在webapp下,不更改会出现在static找不到新建的html的情况
17、阿里脚手架的pom异常
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
</plugin>
18、前端调用接口时提示跨域
在controller类加上注解@CrossOrigin
19、打印sql
在application.properties中
logging.level.com.example.dao:debug
注意com.example.dao取决于你自己的路径
19、集成mysql
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/数据库名?useSSL=false&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&serverTimezone=Asia/Shanghai
spring.datasource.username=用户名
spring.datasource.password=密码