Q:

Spring 2.5.4 return a integer on ajax request

I am working on a spring 2.5.4 project, where I need to get an ajax response that returns a integer value on ajax request. Is there is some way I can do it?
For now, I believe all ajax calls either returns a page or a part of page.
The sample code I am using for ajax request with prototype is as follows,
var ajaxSourceTable = new Ajax.Request(
    '../fetch/timeout.html?ajax=true',
    {   method:'post', 
        parameters:{}, 
        onSuccess:function(t){
            /*alert time out here*/
            alert(t.responseText); 
        }, 
        onFailure:function(t){
            alert("Request failed ! Please report the issue : "+t.responseText);
        }
    }
);

A:

Your ../fetch/timeout.html?ajax=true has to return the single value. You should rather write a controller for that which return text/plain or application/json with the data in the response body.

