if (itemId.intValue() == -1) { sp.printHTML("ERROR: ItemId is -1.<br>"); return ; }
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException  {    String  value = request.getParameter("itemId");    Integer itemId;        sp = new ServletPrinter(response, "ViewBidHistory");    if ((value == null) || (value.equals("")))    {      sp.printHTMLheader("RUBiS ERROR: View bids history");      sp.printHTML("<h3>You must provide an item identifier !<br></h3>");      sp.printHTMLfooter();      return ;    }    else      itemId = new Integer(value);    sp.printHTMLheader("RUBiS: Bid history");    try    {      initialContext = new InitialContext();    }     catch (Exception e)     {      sp.printHTML("Cannot get initial context for JNDI: " + e+"<br>");      sp.printHTMLfooter();      return ;    }    // We want to start transactions from client: get UserTransaction    try    {      utx = (javax.transaction.UserTransaction)initialContext.lookup(Config.UserTransaction);    }     catch (Exception e)    {      sp.printHTML("Cannot lookup UserTransaction: "+e+"<br>");      return ;    }    // Try to find the item corresponding to the itemId    ItemHome iHome;    try     {      iHome = (ItemHome)PortableRemoteObject.narrow(initialContext.lookup("ItemHome"),                                                    ItemHome.class);    }     catch (Exception e)    {      sp.printHTML("Cannot lookup item: " +e+"<br>");      sp.printHTMLfooter();      return ;    }    try    {      Item item = iHome.findByPrimaryKey(new ItemPK(itemId));      sp.printHTML("<center><h3>Bid History for "+item.getName()+"<br></h3></center>");    }    catch (Exception e)    {      sp.printHTML("This item does not exist (got exception: " +e+")<br>");      sp.printHTMLfooter();      return ;    }		    listBids(itemId);    sp.printHTMLfooter();  }