Click here to attend Spring Framework 4.x and certification course with a discount

//city list
width: 300,
max: 10,
delay: 0,
minLength: 1,
autoFocus: false,
cacheLength: 1,
scroll: true,
highlight: false,
source: function(request, response) {
type : "POST",
url: "<%=request.getContextPath()%>/cityList.k",
dataType: "json",
data: "cityName=" + $("input#location").val(),
success: function( data, textStatus, jqXHR) {
//console.log( data.idCity);
var items = data;
//jQuery.each(data, function(i, val) {
error: function(jqXHR, textStatus, errorThrown){
}, close: function (event, ui) {
//alert('close' +this.value);
return false;
select: function (event, ui) {
return false;
focus: function(event, ui) {
return false;
}).data("autocomplete")._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a>" + item.cityName + "</a>")
@RequestMapping(value="/cityList.k", method=RequestMethod.POST)
public @ResponseBody List<City> cityList(
@RequestParam("cityName") String cityName,
ModelMap model, HttpServletRequest request) throws Exception {
List<City> cityList = locationManager.cityList(cityName);
return cityList;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s