KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > rubis > servlets > SellItemForm


1 package edu.rice.rubis.servlets;
2
3 import java.io.IOException JavaDoc;
4
5 import javax.servlet.ServletException JavaDoc;
6 import javax.servlet.http.HttpServlet JavaDoc;
7 import javax.servlet.http.HttpServletRequest JavaDoc;
8 import javax.servlet.http.HttpServletResponse JavaDoc;
9
10 /**
11  * Builds the html page that display the form to register a new item to sell.
12  * @author <a HREF="mailto:cecchet@rice.edu">Emmanuel Cecchet</a> and <a HREF="mailto:julie.marguerite@inrialpes.fr">Julie Marguerite</a>
13  * @version 1.0
14  */

15 public class SellItemForm extends HttpServlet JavaDoc
16 {
17
18
19   public void doPost(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response)
20     throws IOException JavaDoc, ServletException JavaDoc
21   {
22     doGet(request, response);
23   }
24
25   /** Build the html page for the response */
26   public void doGet(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response)
27     throws IOException JavaDoc, ServletException JavaDoc
28   {
29     String JavaDoc 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