ajax请求
来源:互联网 发布:开淘宝规则 编辑:程序博客网 时间:2024/06/06 05:45
iconCls="icon-add" plain="true" onclick="aa()">新</a>
function aa(){
var ency = {
"id":99,
"isHot":1,
};
$.ajax({
type:'POST',
url:"<%=basePath%>news/current.action",
data:ency,
contentType:"application/x-www-form-urlencoded;charset=UTF-8",
success: function(result){
if(result==1){
alert(result)
location.href = '../news/text.action';
}
}
})
}
@RequestMapping(value = "/current.action",produces = "application/json;charset=UTF-8")
@ResponseBody
public String current(Integer id, boolean isHot,ModelMap model,HttpSession session) {
newsService.updateCount(id);
News news = newsService.getNews(id, isHot);
session.setAttribute("news", news);
//model.addAttribute("n", news);
return "1";
}
@RequestMapping(value = "/text.action")
public String text(ModelMap model,HttpSession session) {
News news = (News) session.getAttribute("news");
model.addAttribute("n", news);
return "news";
}
- AJAX请求
- ajax 请求
- ajax请求
- AJax请求
- Ajax请求
- $.ajax()请求
- Ajax请求
- ajax请求
- Ajax请求
- ajax请求
- Ajax请求
- ajax请求
- ajax请求
- Ajax 请求
- Ajax请求
- ajax请求
- AJAX请求
- ajax请求
- Unindexed remote maven repositories found
- [bzoj3048][Usaco2013 Jan]Cow Lineup(离散+莫队)
- wamp server 多站点多域名 vhost 配置
- 正则表达式的贪婪匹配与懒惰匹配
- 针对后台返回Object 对象数据的操作
- ajax请求
- RNN
- (二)spring cloud云服务架构
- Java多线程系列--“JUC线程池”02之 线程池原理(一)
- 默慈恩金数
- 网络操作系统有哪些
- 设计模式·Sunny
- 初学者mysql+mybatis-springboot的demo
- Java通过百度地图API获取地址经纬度