[jQuery] Jquery autocomplete with spring MVC

[jQuery] Jquery autocomplete with spring MVC


I have jquery auto complete example working. Trying to integrate with
spring MVC.
I use InternalResourceViewResolver and SimpleUrlHandlerMapping.
I am trying to pass url in autocomplete(url), which is mapped to
multiactioncontroller which returns array based on value entered in
tex box.
But its returning entire jsp instead of array.
Jsp
Code:
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/
autocomplete/demo/main.css" type="text/css" />
<link rel="stylesheet" href="http://dev.jquery.com/view/trunk/
plugins/autocomplete/jquery.autocomplete.css" type="text/css" />
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/
plugins/autocomplete/jquery.autocomplete.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/
plugins/autocomplete/lib/jquery.bgiframe.min.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/
plugins/autocomplete/lib/query.ajaxQueue.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/
plugins/autocomplete/lib/thickbox-compressed.js"></script>
<script>
$(document).ready(function(){
var url = "searchResult.htm";
$("#example").autocomplete(url);
});
</script>
</head>
<body>
API Reference: <input id="example" /> (try "C" or "E")
</body>
</html>
Here is what I return in multiaction actroller
Code:
searchVal = ServletRequestUtils.getStringParameter(request, "q");
list= service.getResult(searchVal );
return new ModelAndView("SEARCH", "Arr", list.toArray());
Thanks in advance.
Any help will be appreciated.
Anny