我有以下 3countryList
Korea, Republic of
Iran, Islamic Republic of,
Virgin Islands, U.S.
我通过$.ajax()
方法发送它
countryList: "Korea, Republic of,Iran, Islamic Republic of,Virgin Islands, U.S."
在我的servlet中我有代码..
if(request.getParameterMap().containsKey("countryList")){
String countryList = request.getParameter("countryList");
String [] countries = splitCountries(countryList);
for(int i = 0;i < countries.length;i++){
String currentCountry = countries[i];
dao.addCountry(username, currentCountry);
}
}
public String[] splitCountries(final String Countries)
{
return Countries.split(",");
}
我想要整个 3 个国家的名字,但它不给?