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 21 22 23 public class PutCommentAuth extends HttpServlet 24 { 25 26 34 public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException 35 { 36 ServletPrinter sp = null; 37 sp = new ServletPrinter(response, "PubCommentAuth"); 38 39 String to = request.getParameter("to"); 40 String item = request.getParameter("itemId"); 41 if ((to == null) || (to.equals("")) || (item == null) || (item.equals(""))) 42 { 43 sp.printHTMLheader("RUBiS ERROR: Authentification for comment"); 44 sp.printHTML("No item or user identifier received - Cannot process the request<br>"); 45 sp.printHTMLfooter(); 46 return ; 47 } 48 49 sp.printHTMLheader("RUBiS: User authentification for comment"); 50 sp.printFile(Config.HTMLFilesPath+"/put_comment_auth_header.html"); 51 sp.printHTML("<input type=hidden name=\"to\" value=\""+to+"\">"); 52 sp.printHTML("<input type=hidden name=\"itemId\" value=\""+item+"\">"); 53 sp.printFile(Config.HTMLFilesPath+"/auth_footer.html"); 54 sp.printHTMLfooter(); 55 } 56 57 65 public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException 66 { 67 doGet(request, response); 68 } 69 } 70 | Popular Tags |