// import SharedObjects;
// import AuctionQueryHandler;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class AuctionRevivalServlet extends HttpServlet
{
	 //AuctionQueryHandler SharedObjects.aqh = new AuctionQueryHandler();

	 public void doPost (HttpServletRequest request, HttpServletResponse response)
		  throws ServletException, IOException
		  {			   
			   System.out.println("in do post of reevival ");

			   HttpSession hs = request.getSession(false);

			   PrintWriter out = response.getWriter();
			   response.setContentType("text/html");
			   System.out.println("in do get: at 1 ");
			   String param = "";
			   param += request.getParameter("productID");
			   System.out.println("prodid= " + param);
			   //System.out.println("category= " + request.getParameter("category"));

			   //SharedObjects.aqh.handleSellFormDisplay(out, param);
			   try
			   {
			   SharedObjects.qe.handleAuctionRevival(out, Integer.parseInt(param), request);
			   }
			   catch(NumberFormatException ne){System.out.println("$$$$$$no format error in reveval" + ne);}
			   System.out.println("in do get: at 2 ");
			   //SharedObjects.aqh.closeConn();
			   //out.close();
			   System.out.println("in do get:done ");
		  }

	 //-----------------------------------------------------------------------------
	 public void doGet (HttpServletRequest request, HttpServletResponse response)
		  throws ServletException, IOException
		  {			   
			   System.out.println("in do get ");

			   HttpSession hs = request.getSession(false);

			   PrintWriter out = response.getWriter();
			   response.setContentType("text/html");
			   System.out.println("in do get auctio reev servlet: at 1 ");
			   String param = "";
			   param += request.getParameter("productId");
			   System.out.println("prodid= " + param);
			   //System.out.println("category= " + request.getParameter("category"));

			   //SharedObjects.aqh.handleSellFormDisplay(out, param:productID);
			   //SharedObjects.qe.handleAuctionRevival(out, Integer.parseInt(param));
			   SharedObjects.qe.handleAuctionRevivalDisplay(out, Integer.parseInt(param));

			   System.out.println("in do get: at 2 ");
			   //SharedObjects.aqh.closeConn();
			   //out.close();
			   System.out.println("in do get:done ");
		  }
}




