sp.printHTML("Cannot lookup SB_StoreComment: " +e+"<br>");
printError("Cannot lookup SB_StoreComment: " +e+"<br>");
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException  {    Integer toId;    // to user id    Integer fromId;  // from user id    Integer itemId;  // item id    String  comment; // user comment    Integer rating;  // user rating    sp = new ServletPrinter(response, "StoreComment");    /* Get and check all parameters */    String value = request.getParameter("to");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a 'to user' identifier !<br></h3>");      return ;    }    else      toId = new Integer(value);    value = request.getParameter("from");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a 'from user' identifier !<br></h3>");      return ;    }    else      fromId = 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("rating");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a rating !<br></h3>");      return ;    }    else      rating = new Integer(value);    comment = request.getParameter("comment");    if ((comment == null) || (comment.equals("")))    {      printError("<h3>You must provide a comment !<br></h3>");      return ;    }    try    {      initialContext = new InitialContext();    }     catch (Exception e)     {      printError("Cannot get initial context for JNDI: " + e+"<br>");      return ;    }    SB_StoreCommentHome scHome;    SB_StoreComment sb_StoreComment;    try     {      scHome = (SB_StoreCommentHome)PortableRemoteObject.narrow(initialContext.lookup("SB_StoreCommentHome"),                                                     SB_StoreCommentHome.class);      sb_StoreComment = scHome.create();    }     catch (Exception e)    {      sp.printHTML("Cannot lookup SB_StoreComment: " +e+"<br>");      return ;    }    try    {      sb_StoreComment.createComment(fromId, toId, itemId, rating.intValue(), comment);      sp.printHTMLheader("RUBiS: Comment posting");      sp.printHTML("<center><h2>Your comment has been successfully posted.</h2></center>\n");      sp.printHTMLfooter();    }    catch (Exception e)    {      printError("Error while storing the comment (got exception: " +e+")<br>");    }  }