重定向 URL:在 Fullcalendar 的事件源中"xyz" 和 操作类



我是web应用程序开发的新手,目前我在工作中分配了一个web应用程序,在那里我需要使用struts2 java实现完整的日历,我已经显示了它,但我无法将其重定向到从mySQL获取数据并显示它的操作类。请给我指点一下怎么做,我已经尝试了8天了,但仍然没有运气。

谢谢! !

代码补充道:

我知道java/servlet获取json feed的事件源语法是:

eventSources: [{
            url: '/mailexample/calendarevents',
            type: 'GET',
             dataType: 'json',
          }]

到目前为止,我已经尝试了:

url: 'calanderevents.action',
type: 'GET',
 dataType: 'json',

 url action: 'calendarevents',
    type: 'GET',
     dataType: 'json',

url: 'calendarevents',  
// where calendar events maps to an action class
        type: 'GET',
         dataType: 'json',

这些似乎都不起作用。请帮助。

应该是这样的…试试

$('#calendar').fullCalendar({
events: function(start, end, callback) {
    $.ajax({
        url: 'calanderevents.action',
        dataType: 'json',
        data: {
            // our hypothetical feed requires UNIX timestamps
            start: Math.round(start.getTime() / 1000),
            end: Math.round(end.getTime() / 1000)
        },
        success: function(data) {
            var events = [];
            // logic to get each item from data and push it in events array
            callback(events);
        }
    });
}
});

最新更新