Package it.hotel.controller.photo

Source Code of it.hotel.controller.photo.PhotoController

package it.hotel.controller.photo;

import it.hotel.model.photo.Photo;
import it.hotel.model.structure.Structure;
import it.hotel.model.structure.manager.IStructureManager;

import java.util.Collection;

import javax.annotation.Resource;
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 PhotoController implements Controller{
 
  IStructureManager structureManager;
 
  public ModelAndView handleRequest(HttpServletRequest req,
      HttpServletResponse resp) throws Exception {
    String idString = req.getParameter("id");
    
   
    Structure hotel=(Structure) structureManager.get(Integer.parseInt(idString));
    Collection<Photo> photos = (Collection<Photo>)hotel.getGallery().getPhotos();
   
    ModelAndView mv= new ModelAndView("photo","photos",photos) ;
   
      
       
     
       return mv;
  }

 
 
 
  @Resource(name = "structureManager")
  public void setStructureManager(IStructureManager structureManager) {
    this.structureManager = structureManager;
  }


  public IStructureManager getStructureManager() {
    return structureManager;
  }

}
TOP

Related Classes of it.hotel.controller.photo.PhotoController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.