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 19 20 public class PutBidAuth extends HttpServlet 21 { 22 23 24 public void doGet(HttpServletRequest request, HttpServletResponse response) 25 throws IOException , ServletException 26 { 27 ServletPrinter sp = null; 28 sp = new ServletPrinter(response, "PubBidAuth"); 29 30 String value = request.getParameter("itemId"); 31 if ((value == null) || (value.equals(""))) 32 { 33 sp.printHTMLheader("RUBiS ERROR: Authentification for bidding"); 34 sp.printHTML( 35 "No item identifier received - Cannot process the request<br>"); 36 sp.printHTMLfooter(); 37 return; 38 } 39 40 sp.printHTMLheader("RUBiS: User authentification for bidding"); 41 sp.printFile(Config.HTMLFilesPath + "/put_bid_auth_header.html"); 42 sp.printHTML("<input type=hidden name=\"itemId\" value=\"" + value + "\">"); 43 sp.printFile(Config.HTMLFilesPath + "/auth_footer.html"); 44 sp.printHTMLfooter(); 45 } 46 47 public void doPost(HttpServletRequest request, HttpServletResponse response) 48 throws IOException , ServletException 49 { 50 doGet(request, response); 51 } 52 } 53 | Popular Tags |