1 package edu.rice.rubis.servlets; 2 3 import java.io.IOException ; 4 5 import javax.servlet.ServletException ; 6 import javax.servlet.http.HttpServlet ; 7 import javax.servlet.http.HttpServletRequest ; 8 import javax.servlet.http.HttpServletResponse ; 9 10 15 public class SellItemForm extends HttpServlet 16 { 17 18 19 public void doPost(HttpServletRequest request, HttpServletResponse response) 20 throws IOException , ServletException 21 { 22 doGet(request, response); 23 } 24 25 26 public void doGet(HttpServletRequest request, HttpServletResponse response) 27 throws IOException , ServletException 28 { 29 String categoryId = null, userId = null; 30 31 ServletPrinter sp = null; 32 sp = new ServletPrinter(response, "SellItemForm"); 33 sp.printHTMLheader("Sell your item"); 34 35 categoryId = request.getParameter("category"); 36 userId = request.getParameter("user"); 37 38 sp.printFile(Config.HTMLFilesPath + "/sellItemForm.html"); 39 sp.printHTML( 40 "<input type=hidden name=\"userId\" value=\"" + userId + "\"> "); 41 sp.printHTML( 42 "<input type=hidden name=\"categoryId\" value=\"" + categoryId + "\"> "); 43 sp.printHTMLfooter(); 44 } 45 } 46 | Popular Tags |