package it.hotel.controller.map;
import it.hotel.model.structure.Structure;
import it.hotel.model.structure.manager.IStructureManager;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class MapController implements Controller{
IStructureManager structureManager;
public ModelAndView handleRequest(HttpServletRequest req,
HttpServletResponse resp) throws Exception {
String idString = req.getParameter("id");
String address= null;
Structure hotel = (Structure) structureManager.get(Integer.parseInt(idString));
address= hotel.getAddress()+","+hotel.getCity()+" "+"italia";
ModelAndView mv= new ModelAndView("map","hotel",hotel) ;
return mv;
}
public IStructureManager getStructureManager() {
return structureManager;
}
public void setStructureManager(IStructureManager structureManager) {
this.structureManager = structureManager;
}
}