views:

161

answers:

1

All I want to achieve is to implement a servlet providing a json feed for my fullcalendar application. When I inspect http://arshaw.com/js/fullcalendar/examples/json.html with Bugzilla, I see that GET-requests are sent to receive the json feed.

However, when I use this example within my scenario, fullcalendar seems to send OPTIONS-requests. The only difference is that I replaced "events: "json-events.php" with "http://localhost:8080/CalendarServletTest/HelloWorldServlet" (the url of my servlet). What do I miss? Or is this really a bug?

+2  A: 

jQuery may indeed do this when it needs to fire a crossdomain XMLHttpRequest while the return dataType is not jsonp. This is behaviour by design and it may be dependent on the security configuration of the webbrowser used. The HTTP OPTIONS request should just return an Allow header with a list of request methods which are allowed to be used on the particular URL so that jQuery could then continue accordingly.

This should actually not cause a technical problem, but if you don't want to let it fire an OPTIONS request, then you need to let the servlet run in the same domain, or to implement doOptions() accordingly (the HttpServlet however does its task properly by default, so this should actually not form a technical problem), or to change the dataType to jsonp in Fullcalendar's source (and if necessary report it to the Fullcalendar guys as well).

BalusC