package com.rms.tfc.web;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.rms.tfc.service.PedidoService;
import com.rms.tfc.service.RecibirPedidoBean;

@Controller
public class RecibirPedidoController {

	@Resource
	private PedidoService pedidoService;
	
	@RequestMapping("/RecibirPedido.html")
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String idPedido = request.getParameter("idPedido");
		RecibirPedidoBean recibirPedidoBean = pedidoService.getRecibirPedidoBean(new Long(idPedido));
		return new ModelAndView("recibirPedido", "objetoJSP", recibirPedidoBean);
    }

	public void setPedidoService(PedidoService pedidoService) {
		this.pedidoService = pedidoService;
	}
}