Struts2 jQuery Autocompleter with select box

前端 未结 3 1828
轮回少年
轮回少年 2021-02-11 01:49

I\'ve used the Struts2 jQuery autocompleter for my Struts 2 application.

Here is my code:

JSP:

 

        
3条回答
  •  伪装坚强ぢ
    2021-02-11 02:19

    Do this one

    
    
    

    Instead of this:

    
    

    And make sure you are returning the list from your action class. To check this, do it with your IDE debugger or System.out.print etc.

    ex...
    
    
        -------------
        ------------
        itemList.add(new ListValue("Mysl", "Mysl") );
        System.out.println("Size of my list="+itemList.size());
        return SUCCESS;
    }
    

    And also you should define getter & setters in your action class

    private List itemList; 
        public List getItemList() {
        return itemList;
    } 
    
    public void setItemList(List itemList) {
        this.itemList = itemList;
    }
    

提交回复
热议问题