随笔分类 -  springMVC

摘要:老项目改springMVC后,jsp中的静态资源都访问不到404 jsp能得到,但是jsp里引入的js、css都访问不到,不通过controller直接输入地址没问题 参考下文章发现: 原jsp中js、css的路径是这样写的: 改成如下就好了: 转: springMVC请求返回视图中引入的静态资源路 阅读全文
posted @ 2020-06-03 09:31 戈博折刀 阅读(1242) 评论(0) 推荐(0)
摘要:转: Did not find handler method for[/XXX.html]苡菁 2018-03-29 10:18:02 6860 收藏展开 console: 日志为2016-04-08 15:21:47 Looking up handler method for path /welc 阅读全文
posted @ 2020-05-28 16:52 戈博折刀 阅读(1036) 评论(0) 推荐(0)
摘要:web.xml中 /和/*的区别 2017年12月27日 10:48:12 黒晨 阅读数:3005 2017年12月27日 10:48:12 黒晨 阅读数:3005 < url-pattern > / </ url-pattern > 不会匹配到*.jsp,即:*.jsp不会进入spring的 Di 阅读全文
posted @ 2019-02-26 13:58 戈博折刀 阅读(747) 评论(0) 推荐(0)
摘要:错误400-The request sent by the client was syntactically incorrect 总结: 因为SpringMVC控制层碰到了参数无法解析的错误,或者说请求数据与controller处理方法中的参数不匹配造成的。 解决方法: 检查前台传入后台的参数和后台 阅读全文
posted @ 2018-12-07 14:11 戈博折刀 阅读(1315) 评论(0) 推荐(0)
摘要:ajax向后台传数组是可以直接传的,写法如下 var ids = [ ]; $(dom1).each(function(){ ids.push($(this).val()); }); var userId="123"; var url = path + "/xxx/ajaxAddUser.do?us 阅读全文
posted @ 2018-11-29 13:51 戈博折刀 阅读(996) 评论(0) 推荐(0)
摘要:关于springmvc下服务器文件打包成zip格式下载功能 2016年09月21日 11:22:14 toxic_guantou 阅读数:5731更多 个人分类: 技术点存储 2016年09月21日 11:22:14 toxic_guantou 阅读数:5731更多 个人分类: 技术点存储 个人分类 阅读全文
posted @ 2018-11-16 17:52 戈博折刀 阅读(1478) 评论(0) 推荐(0)
摘要:在springMVC中写拦截器,只需要两步: 一、写 java 拦截器类,实现 interceptor 拦截器接口。 二、在 springMVC 的xml配置文件中,配置我们创建的拦截器对象及其拦截目标 url 首先,在前台门户项目中创建一个拦截器java类: 只要实现拦截器接口,覆盖其中的方法即可 阅读全文
posted @ 2018-10-29 17:26 戈博折刀 阅读(427) 评论(0) 推荐(0)
摘要:springMvc--请求的跳转和传值 目录 forword跳转页面的三种方式 1.使用serlvet 2.使用Model对象 3.使用ModelAndView redirect跳转到页面 使用servlet 使用ModelAndView 跳转到Controller中的方法 forword跳转 目录 阅读全文
posted @ 2018-10-26 17:44 戈博折刀 阅读(171) 评论(0) 推荐(0)
摘要:注意: 如果 SpringMVC 的 Controller 中需要向前台返回字符串(比如ajax的get请求) 可以把 方法的返回值设置成 String 同时在 @RequestMapping 注解中加入produces属性设置返回字符串的编码来避免前台乱码,然后在方法前面加上 @ResponseB 阅读全文
posted @ 2018-10-17 17:59 戈博折刀 阅读(2604) 评论(0) 推荐(0)
摘要:@RequestParam 注解的使用 前言 在SpringMvc后台进行获取数据,一般是两种。 1.request.getParameter(“参数名”) 2.用@RequestParam注解获取 后台代码示范 @RequestMapping("/") public String Demo1(@R 阅读全文
posted @ 2018-09-28 11:01 戈博折刀 阅读(642) 评论(0) 推荐(0)
摘要:前台请求的样式: http://localhost:8080/item/88909 其中参数就是最后的 商品id号 88909 后台Controller中取出参数的方法: 注意:这种写法时,参数中一定要用注解 @PathVariable 阅读全文
posted @ 2018-09-27 14:27 戈博折刀 阅读(1396) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-09-25 15:09 戈博折刀 阅读(1) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-09-22 17:59 戈博折刀 阅读(2) 评论(0) 推荐(0)
摘要:原文: https://www.jb51.net/article/128233.htm SpringMVC接收复杂集合对象(参数)代码示例 更新时间:2017年11月15日 09:18:15 作者:jxd_zxf 我要评论 SpringMVC接收复杂集合对象(参数)代码示例 更新时间:2017年11 阅读全文
posted @ 2018-08-27 15:44 戈博折刀 阅读(554) 评论(0) 推荐(0)
摘要:原:https://blog.csdn.net/u011781521/article/details/77586688/ Spring MVC同时接收一个对象与List集合对象 2017年08月25日 20:52:31 阅读数:13709 原:https://blog.csdn.net/u01178 阅读全文
posted @ 2018-08-21 16:02 戈博折刀 阅读(1080) 评论(0) 推荐(0)
摘要:前台方法(前台部分用的bootstrap): 后台Controller: 这里的id实际就是前台传过来的集合,这种方式,后台的 集合接收变量名称可以随意起名,因为前台传过来的就是一个集合,本身就没有名字,所以这里可以用 “id” 前台传送的参数形式: 阅读全文
posted @ 2018-08-10 15:29 戈博折刀 阅读(528) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-05-07 15:04 戈博折刀 阅读(4) 评论(0) 推荐(0)
摘要:原文:https://blog.csdn.net/annghi/article/details/78925668 2017年12月28日 19:52:22 阅读数:116 2017年12月28日 19:52:22 阅读数:116 阅读数:116 如果你想往后台传送formdata,再直接点,想上传文 阅读全文
posted @ 2018-05-07 15:01 戈博折刀 阅读(265) 评论(0) 推荐(0)
摘要:原文:https://blog.csdn.net/dorothy1224/article/details/79136676 上传文件(文件非必填)MultipartHttpServletRequest 原创 2018年01月23日 10:36:51 原创 2018年01月23日 10:36:51 背 阅读全文
posted @ 2018-04-10 11:10 戈博折刀 阅读(946) 评论(0) 推荐(0)
摘要:这个是 源码中 ModelMap的定义 类 public class ModelMap extends LinkedHashMap说明 ModelMap是继承自LinkedHashMap的,则put方法是继承自 HashMap的方法,没什么特殊而addAttribute方法的定义public ModelMap addAttribute(String attributeName, Object... 阅读全文
posted @ 2018-01-30 17:34 戈博折刀 阅读(2468) 评论(0) 推荐(0)