作者a11780922 (萝卜特务)
看板Web_Design
标题[问题] JSP 使用ajax post 给另一个jsp档
时间Thu Apr 26 10:40:02 2018
程式码如下
$.ajax({
type: "POST",
url: "change.jsp",
data: {
screenlayout: $("
#screenlayout").val(), template:
$("
#template").val()
},
success: function(response){
alert(response);
},
error: function(xhr, ajaxOptions, thrownError){
alert("error"+xhr.status);
alert(thrownError.Error);
}
});
此事件是当我按下按钮会触发
但都是出现error错误:500 undefined
跟网路上范例都一样不知道为什麽一直错误 我也不知道没定义到了甚麽
烦请高手解惑
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 123.192.44.78
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Web_Design/M.1524710404.A.E42.html
1F:推 froce: 500是内部伺服器错误,所以应该是有送request出去 04/26 11:12
2F:→ froce: 请去看看你後端JSP逻辑是否有错,把request接出来看看 04/26 11:13
3F:→ a11780922: 我现在改用serverlet去抓 是有成功抓到 而我主要目的是 04/26 11:48
4F:→ a11780922: 抓到参数後把他 存成档案 刚刚用java写档的方式去写 好 04/26 11:49
5F:→ a11780922: 像 写入不了 一般是可以这样写档的吗? 谢谢 04/26 11:49
6F:→ ssccg: 你要先看写入不了是为什麽写入不了? 路径? 权限? 04/26 15:23
7F:推 froce: 感觉应该是权限或路径的问题 04/26 15:28
8F:→ a11780922: 已解决 感谢各位 04/29 23:20