I am attempting to make use of spring 3 ajax with a simple heartbeat checker. In the jsp I have code that makes the following call:
function testHeartBeat()
{ $.getJSON( "myApp/StatusCheck?message=Status",
function( data ) {
document.getElementById( "heartbeatStatus" ).value = data.response;});}
The controller which receives this is:
@RequestMapping(value="/StatusCheck", method=RequestMethod.GET )
public @ResponseBody HeartBeat getHeartbeat( @RequestParam String message )
{ HeartBeat hb = HeartBeat.Transmit( message );
return ( hb ); }
The getHeartbeat is called and returns back a heartbeat object but the callback function in the javascript never runs apparently. I am using <mvc:annotation-driven /> with spring mvc 3.0.5. What I get back is a 406 error: "The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers ()."


Reply With Quote
[B) Incompatible argument to function
