首页 > 其他 > 详细

SSM

时间:2019-08-12 11:29:30      阅读:107      评论:0      收藏:0      [点我收藏+]

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

解决:

未解决

SSM

原文:https://www.cnblogs.com/SuperT/p/11337853.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!