i have a service that retrieve a list of continent model like the following
@Override
@Transactional
public List<ContinentCountryModel> continentCtry() {
List<ContinentCountryModel> continentCtryModelList = new ArrayList<>();
List<Continent> continentList = this.getContinentList();
if (continentList != null) {
for (Continent continent : continentList) {
List<Country> countryList = this.getCountryList(continent.getContinentId());
ContinentCountryModel model = new ContinentCountryModel();
model.setContinent(continent);
model.setCountryList(countryList);
continentCtryModelList.add(model);
}
}
return continentCtryModelList;
}
and the following model
private Continent continent;
private List<Country> countryList;
public Continent getContinent() {
return continent;
}
public void setContinent(Continent continent) {
this.continent = continent;
}
public List<Country> getCountryList() {
return countryList;
}
public void setCountryList(List<Country> countryList) {
this.countryList = countryList;
}
now i am calling this service in a controller using the following code
@RequestMapping(value="/getContienent")
@ResponseBody
public List<ContinentCountryModel> getAllContienents()
{
logger.info("here we are retriving either contienent or countries "+servicesConfigurations.continentCtry());
return servicesConfigurations.continentCtry();
}
the issue is that i want to display a list of all continent and countries inside in front end using js ,i.checks boot strap library and html any suggestion on how to do this ,put on mind that i am calling this service in ajax put ,i don't know how to handle this front end wise
any suggestion code to handle this in html and js please some sample code would be great
Aucun commentaire:
Enregistrer un commentaire