jquery插件autoSuggestv输入框自动补全

阅读更多
官方地址: click  me



  
    auto
	
    
    
    
    
    
  
  
  
  
  	




package net.alice.json;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;


/**
 * 类描述:AutoSuggest插件支持,action继承该类,方便处理返回数据
 * @version: 1.0
 * @date: 2014-1-18 下午9:22:32
 * **/
@SuppressWarnings("serial")
public class AutoSuggestSupport extends ActionSupport{
	private List items = new ArrayList();
	
	public List getItems() {
		return items;
	}
	public void setItems(List items) {
		this.items = items;
	}
	

	public String execute() throws Exception {
		items.add(new AutoSuggest("1", "alice"));
		items.add(new AutoSuggest("2", "komoe"));
		items.add(new AutoSuggest("3", "nagi"));
		items.add(new AutoSuggest("4", "arisu"));
		items.add(new AutoSuggest("5", "kobado"));
        return SUCCESS;
	}

}






package net.alice.json;

public class AutoSuggest {
	private String name;
	private String value;

	public String getName() {
		return name;
	}

	public String getValue() {
		return value;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public AutoSuggest(String name, String value) {
		this.name = name;
		this.value = value;
	}

}

你可能感兴趣的:(jquery,json,java)