private void searchItems(ServletOutputStream out, HttpServletRequest request) throws IOException { String searchString=request.getParameter( "searchString"); String text = "Click Item number for description and to place bid."; setTitle(out, "Search Results"); try { addLine("<BR>"+text, out); //Look up Home interfaces AuctionItemHome ahome = ( AuctionItemHome) ctx.lookup( "auctionitems"); SearchHome shome=( SearchHome) ctx.lookup("search"); //Create remote interface for search Bean Search search=shome.create(); //Call search method and pass the search string Enumeration enum=(Enumeration) search.getMatchingItemsList(searchString); addLine("<TABLE BORDER=1 CELLPADDING=1 CELLSPACING=0> <TR> <TH>Item<TH> <TH>Summary<TH> <TH>Current High bid<TH> <TH>Number of bids<TH> <TH>Closing Date<TH><TR>", out); //Iterate through search results while ((enum != null) && (enum.hasMoreElements())) { while(enum.hasMoreElements(in)) { //Locate auction items AuctionItem ai=ahome.findByPrimaryKey(( AuctionItemPK)enum.nextElement()); displayLineItem(ai, out); } } addLine("<TABLE>", out); } catch (Exception e) { addLine("AuctionServlet Search Items error", out); System.out.println("AuctionServlet :"+e); } out.flush(); }