1 package edu.rice.rubis.beans.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 21 public class BuyNowAuth extends HttpServlet 22 { 23 24 31 public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException 32 { 33 ServletPrinter sp = null; 34 sp = new ServletPrinter(response, "BuyNowAuth"); 35 36 String value = request.getParameter("itemId"); 37 if ((value == null) || (value.equals(""))) 38 { 39 sp.printHTMLheader("RUBiS ERROR: Authentification for buying an item"); 40 sp.printHTML("No item identifier received - Cannot process the request<br>"); 41 sp.printHTMLfooter(); 42 return ; 43 } 44 45 sp.printHTMLheader("RUBiS: User authentification for buying an item"); 46 sp.printFile(Config.HTMLFilesPath+"/buy_now_auth_header.html"); 47 sp.printHTML("<input type=hidden name=\"itemId\" value=\""+value+"\">"); 48 sp.printFile(Config.HTMLFilesPath+"/auth_footer.html"); 49 sp.printHTMLfooter(); 50 } 51 52 59 public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException 60 { 61 doGet(request, response); 62 } 63 } 64 | Popular Tags |