Struts2 jQuery Autocompleter with select box

前端 未结 3 2050
忘了有多久
忘了有多久 2021-02-11 01:41

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

Here is my code:

JSP:

 

        
3条回答
  •  暖寄归人
    2021-02-11 02:29

    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;
    }
    

提交回复
热议问题