FileDocCategorySizeDatePackage
UserSuggestAction.javaAPI DocExample1123Wed Apr 05 20:04:52 BST 2006com.oreilly.ajax

UserSuggestAction

public class UserSuggestAction extends fr.improve.struts.taglib.layout.suggest.SuggestAction

Fields Summary
Constructors Summary
Methods Summary
public java.util.CollectiongetSuggestionList(javax.servlet.http.HttpServletRequest in_request, java.lang.String in_word)

        
        // Get all the country names
        Collection allCountries = CountryCollection.getAllCountries();
        
        // Start to build the suggestions list
        ArrayList suggestions = new ArrayList();
        
        if (in_word != null && in_word.length() > 0)
        {
            Iterator iter = allCountries.iterator();
            
            while(iter.hasNext())
            {
                String currentWord = (String) iter.next();
                
                if(currentWord.toLowerCase().startsWith(in_word.toLowerCase()))
                    suggestions.add(currentWord);
            }
        }
        
        return suggestions;