SSM

SSM

错误
第一个:
Mapper method 'com.zwt.springmvc.crud.Dao.EmployeeDao.DeleteId' has an unsupported return type: class com.zwt.springmvc.crud.entities.Employee

解决:

delete, update, insert等操作单时候,dao层返回为int类型

Employee DeleteId(Integer id); 
应改为
int DeleteId(Integer id);

delete操作返回int

第二个:
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

解决:

页面输入数据的时候格式不正确

salary :1.222.333.1 改为#,###,###.#
第三个:

问题

删除完成返回时出现:

页面显示redirect:/epms,却并不跳转

解决:

去掉@ResponseBody注解

第四个:

问题:

Request method 'PUT' not supported

解决:

@RequestMapping(value="/emp/{id}", method=RequestMethod.POST)
public String update(Employee employee,Map<String, Object> map){    
    map.put("employee", employee);    
    employeeDao.update(employee);    
    System.out.println("update success");    
    return "redirect:/epms";
}

将上方代码改为如下:

@RequestMapping(value = "/emp", method = RequestMethod.PUT)
public String update(Employee employee){   
    employeeDao.update(employee);    
    System.out.println("Success" +employee);    
    return "redirect:/epms";
}
第五个:

问题

check the manual that corresponds to your MySQL server version for the right syntax to use near '= '111@qq.com', gender = null, department = '镨镨2',salary = nullwhere i' at line 1

似乎sql写错了

UPDATE employee SETemail = #{email}, gender = #{gender}, department = #{department},salary = #{salary}where id = #{id}

解决:

在SET后添加空格

第六个:

问题:

前段页面显示中文乱码

解决:

jsp页面中加入

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
第七个:

错误:

Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.validation.BootstrapConfiguration.getClockProviderClassName()Ljava/lang/String;    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.

解决:

原因是导入的依赖于Mybatis冲突

删除下方依赖即可

<!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator --><dependency>  
    <groupId>org.hibernate.validator</groupId>  
    <artifactId>hibernate-validator</artifactId>  
    <version>6.0.16.Final</version>
</dependency>
第八个:

问题:

Tomcat关闭时报错

 Web应用程序 [ROOT] 注册了JDBC驱动程序 [com.mysql.jdbc.Driver],但在Web应用程序停止时无法注销它。 为防止内存泄漏,JDBC驱动程序已被强制取消注册。

解决:

未解决

转载于:https://www.cnblogs.com/SuperT/p/11337853.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值