sp.printHTML("Cannot lookup SB_StoreBuyNow: " +e+"<br>");
printError("Cannot lookup SB_StoreBuyNow: " +e+"<br>");
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException  {    Integer userId; // item id    Integer itemId; // user id    float   minBuyNow; // minimum acceptable BuyNow for this item    float   BuyNow;    // user BuyNow    float   maxBuyNow; // maximum BuyNow the user wants    int     maxQty; // maximum quantity available for this item    int     qty;    // quantity asked by the user    sp = new ServletPrinter(response, "StoreBuyNow");    /* Get and check all parameters */    String value = request.getParameter("userId");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a user identifier !<br></h3>");      return ;    }    else      userId = new Integer(value);    value = request.getParameter("itemId");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide an item identifier !<br></h3>");      return ;    }    else      itemId = new Integer(value);    value = request.getParameter("maxQty");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a maximum quantity !<br></h3>");      return ;    }    else    {      Integer foo = new Integer(value);      maxQty = foo.intValue();    }    value = request.getParameter("qty");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a quantity !<br></h3>");      return ;    }    else    {      Integer foo = new Integer(value);      qty = foo.intValue();    }    /* Check for invalid values */    if (qty > maxQty)    {      printError("<h3>You cannot request "+qty+" items because only "+maxQty+" are proposed !<br></h3>");      return ;    }          try    {      initialContext = new InitialContext();    }     catch (Exception e)     {      printError("Cannot get initial context for JNDI: " + e+"<br>");      return ;    }    SB_StoreBuyNowHome buyHome;    SB_StoreBuyNow buy;     try     {      buyHome = (SB_StoreBuyNowHome)PortableRemoteObject.narrow(initialContext.lookup("SB_StoreBuyNowHome"),                                                     SB_StoreBuyNowHome.class);      buy = buyHome.create();    }     catch (Exception e)    {      sp.printHTML("Cannot lookup SB_StoreBuyNow: " +e+"<br>");      return ;    }    try     {      buy.createBuyNow(itemId, userId, qty);      sp.printHTMLheader("RUBiS: BuyNow result");      if (qty == 1)        sp.printHTML("<center><h2>Your have successfully bought this item.</h2></center>\n");      else        sp.printHTML("<center><h2>Your have successfully bought these items.</h2></center>\n");    }    catch (Exception e)    {      printError("Error while storing the BuyNow (got exception: " +e+")<br>");      return ;    }		    sp.printHTMLfooter();  }