摘要: $.ajax({})中的success()函数是ajax向后台请求成功后自动调用的,在success(response)函数里面的变量只有一个,response是后台返回来的值。 当后端没有给前端传回值时,$.ajax()中不会执行success,执行的是error。 在项目中,当后端servlet 阅读全文
posted @ 2019-04-14 12:36 奔跑啊mshan 阅读(5267) 评论(0) 推荐(0) 编辑
摘要: 后端创建cookie Cookie userCookie=new Cookie("userCookie",cookValue); userCookie.setMaxAge(7*24*60*60); //设置cookie的最大生命周期为一周 userCookie.setPath("/"); //设置路径为全路径(这样写的好处是同一项目下的页面都可以访问该cookie) respon... 阅读全文
posted @ 2019-04-14 11:56 奔跑啊mshan 阅读(4609) 评论(0) 推荐(1) 编辑
摘要: SimpleDateFormat的用法: 另: 用例: 阅读全文
posted @ 2019-04-14 11:27 奔跑啊mshan 阅读(40410) 评论(0) 推荐(1) 编辑
摘要: Servelt里面的setContentType: 当setContentType里属性为application/json时,前后端数据交互时,数据格式为json对象或者json对象数组; 当setContentType里属性为text/html时,前后端数据交互时,数据格式为json字符串或者js 阅读全文
posted @ 2019-04-14 10:50 奔跑啊mshan 阅读(2486) 评论(0) 推荐(0) 编辑