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