无法使用struts2在完整日历中检索json值
在我的jsp页面中 迭代按钮//让我假设迭代中有两个按钮无法使用struts2在完整日历中检索json值,json,struts2,Json,Struts2,在我的jsp页面中 迭代按钮//让我假设迭代中有两个按钮 <s:iterator value="%{#session.allrefrence}"> <button class="btn " style=" background: #DB7093;color: white; " id="ref" value="%{refrenceid}" ></button> </s:itera
<s:iterator value="%{#session.allrefrence}">
<button class="btn " style=" background: #DB7093;color: white; " id="ref" value="%{refrenceid}" ></button>
</s:iterator>
此代码有什么问题?我无法在日历中打印标题值,任何帮助都将是可观的尝试此操作+从您的操作结果中删除所有
$(文档).ready(函数(){
$(“#日历”).fullCalendar({
标题:{
左:'标题',
右图:“今天上一个,下一个”
},
违约日期:“2016-09-06”,
可编辑:false,
数据类型:“json”,
事件:函数(开始、结束、时区、回调){
$.ajax({
url:“/Management/Calenderpick”,
数据:{
//如果您通过,请输入数据
},
成功:功能(数据){
var事件=[];
事件。推({
标题:data.title,
开始:data.start,
结束:data.end
});
回调(事件);
},
错误:函数(e,x,y){
控制台日志(e);
控制台日志(x);
控制台日志(y);
}
});
}
});
});代码>我从未尝试序列化多个根对象,如果可能的话,尝试将它们作为数据获取。title
,数据。开始
同样地…你也可以显示完整的动作类
吗?我的动作类中除了getter和setter之外没有其他东西,请告诉我如何获取作为数据的值。title和我是stutrs2的新手显示你对动作的调用日历拾取
ajax…好的…fullcalender具有属性事件:
到操作您是否删除了
,并且您的操作的execute
被执行了?是的,它已经执行了可能是因为我设置了默认日期:'2016-09-06',
,并且您正在检查同一个月我试图向控制器发送数据,但我收到了错误
<script type="text/javascript">
$(document).ready(function() {
$('#ref')
.click(
function() {
$('#calendar').fullCalendar({
header: {
left: 'title',
right: ' today prev,next'
},
defaultDate: new Date(),
editable: false,
dataType: 'json',
events: function(start, end, timezone, callback) {
$.ajax({
url: '/Management/Calenderpick',
data : {reffrenceid : $('#ref').val()},
});
success: function(data) {
var events = [];
events.push({
title: data.title,
start: data.start,
end: data.end
});
callback(events);
},
error: function(e, x, y) {
console.log(e);
console.log(x);
console.log(y);
}
}
});
});
});
</script>
This is my xml configuration
<action name="Studentleave"
class="com.sms.controller.calender.leave">
<result type="json">
<param name="root">calenderList</param>
</result>
</action>
private String title;
private String start;
private String end;
public String execute() {
title = "EventXYZ";
start = "2016-12-02";
end = "2016-12-03";
return SUCCESS;
}
//getters and setters