try { bidHome = (BidHome)PortableRemoteObject.narrow(initialContext.lookup("BidHome"), BidHome.class); } catch (Exception e) { sp.printHTML("Cannot lookup Bid: " +e+"<br>"); return ; }  sp.printBidHistoryHeader();  while (bidList.hasMoreElements()) {  try { bid = bidHome.findByPrimaryKey((BidPK)bidList.nextElement());  } catch (Exception e) { sp.printHTML("Exception getting bid: " + e +"<br>"); sp.printHTMLfooter(); return; }  sp.printBidHistory(bid); } sp.printBidHistoryFooter();
sp.printBidHistory(bid); } sp.printBidHistoryFooter();
  private void listBids(Integer itemId)   {    Enumeration bidList=null;    ItemHome iHome;    QueryHome   qHome = null;    Query       q;    BidHome bidHome;    Bid bid;    Item item;    float price;    String name;    // Connecting to Query Home thru JNDI    try     {      qHome = (QueryHome)PortableRemoteObject.narrow(initialContext.lookup("QueryHome"),                                                     QueryHome.class);    }     catch (Exception e)    {      sp.printHTML("Cannot lookup Query: " +e+"<br>");      return ;    }    // Get the list of the user's last bids    try     {      q = qHome.create();      bidList = q.getItemBidHistory(itemId).elements();    }    catch (Exception e)    {	sp.printHTML("Exception getting bids list: " +e+"<br>");	return ;    }      if ((bidList == null) || (!bidList.hasMoreElements()))      {        sp.printHTML("<h3>There is no bid corresponding to this item.</h3><br>");        return ;      }      // Lookup bid home interface      try 	  {	      bidHome = (BidHome)PortableRemoteObject.narrow(initialContext.lookup("BidHome"),							    BidHome.class);	  }       catch (Exception e)	  {	      sp.printHTML("Cannot lookup Bid: " +e+"<br>");	      return ;	  }       sp.printBidHistoryHeader();      while (bidList.hasMoreElements())       {	  // Get the bids	  try	  {	      bid = bidHome.findByPrimaryKey((BidPK)bidList.nextElement());	      	  }	  catch (Exception e) 	  {	      sp.printHTML("Exception getting bid: " + e +"<br>");	      sp.printHTMLfooter();	      return;	  }	  sp.printBidHistory(bid);      }      sp.printBidHistoryFooter();  }