sp.printHTML("Cannot get the list of items: " +e+"<br>");
printError("Cannot get the list of items: " +e+"<br>");
  private void itemList(Integer categoryId, int page, int nbOfItems)  {    // Connecting to Home thru JNDI    SB_SearchItemsByCategoryHome home = null;    SB_SearchItemsByCategory sb_SearchItemsByCategory = null;    String list = "";    try     {      home = (SB_SearchItemsByCategoryHome)PortableRemoteObject.narrow(initialContext.lookup("SB_SearchItemsByCategoryHome"),                                                     SB_SearchItemsByCategoryHome.class);      sb_SearchItemsByCategory = home.create();    }     catch (Exception e)    {      sp.printHTML("Cannot lookup SB_SearchItemsByCategory: " +e+"<br>");      return ;    }    try     {      list = sb_SearchItemsByCategory.getItems(categoryId, page, nbOfItems);    }     catch (Exception e)    {      sp.printHTML("Cannot get the list of items: " +e+"<br>");      return ;    }    try    {      if ((list != null) && (!list.equals("")))      {        sp.printItemHeader();        sp.printHTML(list);         sp.printItemFooter();      }      else      {        if (page == 0)          sp.printHTML("<h2>Sorry, but there are no items available in this category !</h2>");        else        {          sp.printHTML("<h2>Sorry, but there are no more items available in this category !</h2>");          //          sp.printItemHeader();          sp.printItemFooter("<a href=\"/servlet/edu.rice.rubis.beans.servlets.SearchItemsByCategory?category="+categoryId+                           "&categoryName="+URLEncoder.encode(categoryName)+"&page="+(page-1)+"&nbOfItems="+nbOfItems+"\">Previous page</a>", "");        }        return ;      }      if (page == 0)        sp.printItemFooter("", "<a href=\"/servlet/edu.rice.rubis.beans.servlets.SearchItemsByCategory?category="+categoryId+                           "&categoryName="+URLEncoder.encode(categoryName)+"&page="+(page+1)+"&nbOfItems="+nbOfItems+"\">Next page</a>");      else        sp.printItemFooter("<a href=\"/servlet/edu.rice.rubis.beans.servlets.SearchItemsByCategory?category="+categoryId+                           "&categoryName="+URLEncoder.encode(categoryName)+"&page="+(page-1)+"&nbOfItems="+nbOfItems+"\">Previous page</a>",                           "<a href=\"/servlet/edu.rice.rubis.beans.servlets.SearchItemsByCategory?category="+categoryId+                           "&categoryName="+URLEncoder.encode(categoryName)+"&page="+(page+1)+"&nbOfItems="+nbOfItems+"\">Next page</a>");    }     catch (Exception e)     {      printError("Exception getting item list: " + e +"<br>");    }  }