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驱动程序已被强制取消注册。

解决:

未解决

posted @ 2019-08-12 09:21  底层小鱼  阅读(231)  评论(0编辑  收藏  举报