关于 Could not resolve view with name 'xxx' in servlet with name 'spring-mvc' 的解决方法

1、原因之一,没有写“@ResponseBody“

@RequestMapping("/logout")public Response logout(HttpServletRequest request, HttpServletResponse response) {String result = service.loginOut(request, response);System.out.println("退出登录 result:"+result);Map<String, String> map = new HashMap<>(); map.put("ok", "退出登录");return new Response(200, "", map);}

2、正确写法

@RequestMapping("/logout")
@ResponseBodypublic Response logout(HttpServletRequest request, HttpServletResponse response) {String result = service.loginOut(request, response);System.out.println("退出登录 result:"+result);Map<String, String> map = new HashMap<>(); map.put("ok", "退出登录");return new Response(200, "", map);}

解决控制台Could not resolve view with name ...相关推荐

  1. 造成javax.servlet.ServletException: Could not resolve view with name的各种原因及解决方法

    报错完成信息: javax.servlet.ServletException: Could not resolve view with name '/lose/index' in servlet wi ...

  2. javax.servlet.ServletException: Could not resolve view with name ‘***‘ in servlet

    javax.servlet.ServletException: Could not resolve view with name 'employee/login' in servlet with na ...

  3. Could not resolve view with name '/xx.html' in servlet with name 'dispatcherServlet'

    springboot 项目启动后访问网页,控制台报错: Could not resolve view with name '/xx.html' in servlet with name 'dispat ...

  4. Spring Boot问题之JSP无法显示Could not resolve view with name ‘xxxx‘ in servlet with name ‘dispatcherServlet

    问题: 在Spring Boot应用中JSP页面无法显示, 页面提示: 控制台的错误信息类似: javax.servlet.ServletException: Could not resolve vi ...

  5. IllegalStateException: Could not resolve view with name

    最近遇到一个重定向的问题困扰了很久,百度也找不到合适的解决方案!! 一 .问题描述 使用的技术:springboot(2.6.x) + springcloud gateway(3.1.x): 1.请求 ...

  6. Could not resolve view with name 'xxx' in servlet with name 'dispatcherServlet',

    1,问题 本人启动spring boot项目后,访问接口,报错信息如下: {"timestamp": 1537234637805,"status": 500,& ...

  7. Could not resolve view with name ‘updatelog/saveDetail’

    Could not resolve view with name 'updatelog/saveDetail' in servlet with name 'dispatcherServlet'异常 数 ...

  8. 解决“QGtkStyle could not resolve GTK……”问题

    解决"QGtkStyle could not resolve GTK--"问题 参考文章: (1)解决"QGtkStyle could not resolve GTK-- ...

  9. elasticsearch解决控制台中文乱码问题

    elasticsearch解决控制台中文乱码问题 参考文章: (1)elasticsearch解决控制台中文乱码问题 (2)https://www.cnblogs.com/chenmz1995/p/1 ...

最新文章

  1. Shell基础命令之echo
  2. 任务和特权级保护(四)——《x86汇编语言:从实模式到保护模式》读书笔记35
  3. 这份书单,给那些想学Hadoop大数据、人工智能的人
  4. 深入理解C#:编程技巧总结(一)
  5. ArcGIS怎样获取重分类后各类所占的像元个数
  6. centos 安装MySQL报错You could try using --skip-broken to work around the problem You could try running:
  7. java 并发 set_高并发下的Java数据结构(List、Set、Map、Queue)
  8. Linux磁盘读写速率测试
  9. 天气预报为什么要用超级计算机,为什么天气预报不够准确?
  10. 噪声的频谱分析的重要意义_噪声测量:噪声源识别与定位的方法简析
  11. source insight 深色主题配置文件
  12. mysql insert 主键冲突_在MySql中建立存储过程和解决insert into select 中主键冲突的有关问题...
  13. 使用Vitamio开发iOS平台上的万能播放器
  14. python-普通数据分析-科比职业生涯数据分析
  15. 用PS快速给图片添加逼真彩虹效果
  16. 如何给word文档添加注释
  17. Android基础学习总结(十六)——基于ijkplayer封装支持简单界面UI定制的视频播放器
  18. GD32f103ret6 使用HID,设备管理里,提示未知设备
  19. leetcode 5. 最长回文子串(c++)
  20. 用python画玫瑰花

热门文章

  1. 版面设计编辑软件Swift Publisher 5 Mac
  2. VHDL语言基本单元及其构成——EDA学习笔记(一)
  3. 互联网下半场,具备这个技能的产品经理将越来越值钱!
  4. 如何向gitee开源项目提交代码
  5. React.js加载组件以及JSX脚本处理代码
  6. 虚拟机下装msdos操作系统,再安装borlandc
  7. 如何完整卸载VMware——强力删除vmware-vmx.exe以及
  8. 计算机专业的三行情书,各学科给你的三行情书
  9. python GUI demo(tkinter)
  10. 创建淘宝开放平台应用的步骤简单记录