topic = (Topic) initialContext.lookup("topic/topicSearchItemsByRegion");
topic = (Topic) initialContext.lookup(Config.PrefixTopicName+"topicSearchItemsByRegion");
  private void itemList(Integer categoryId, Integer regionId, int page, int nbOfItems)   {    TopicConnectionFactory topicFactory = null;    TopicConnection connection = null;    TopicSession session  = null;    Topic topic = null;    String list;    try     {      // lookup the connection factory      topicFactory = (TopicConnectionFactory)initialContext.lookup(Config.TopicConnectionFactoryName);      // create a connection to the JMS provider      connection = topicFactory.createTopicConnection();      // lookup the destination      topic = (Topic) initialContext.lookup("topic/topicSearchItemsByRegion");      // create a session      session  = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); // no transaction and auto ack    }     catch (Exception e)    {      sp.printHTML("Cannot connect to message bean MDB_SearchItemsByRegion : " +e+"<br>");      return ;    }    try     {      // create a requestor to receive the reply      TopicRequestor requestor = new TopicRequestor(session, topic);      System.out.println("create requestor");      // create a message      MapMessage message = session.createMapMessage();      // set parameters      message.setInt("categoryId", categoryId.intValue());      message.setInt("regionId", regionId.intValue());      message.setInt("page", page);      message.setInt("nbItems", nbOfItems);      message.setJMSCorrelationID("searchByRegion");      // send the message and receive the reply      connection.start(); // allows message to be delivered (default is connection stopped)      TextMessage reply = (TextMessage)requestor.request(message);      connection.stop();      // read the reply      list = reply.getText();      // close connection and session      requestor.close(); // also close the session      connection.close();    }     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("<h3>Sorry, but there is no items in this category for this region.</h3><br>");        else        {          sp.printHTML("<h3>Sorry, but there is no more items in this category for this region.</h3><br>");          sp.printItemHeader();          sp.printItemFooter("<a href=\""+Config.context+"/servlet/edu.rice.rubis.beans.servlets.SearchItemsByRegion?category="+categoryId+                             "&region="+regionId+"&page="+(page-1)+"&nbOfItems="+nbOfItems+"\">Previous page</a>", "");        }        return ;      }      if (page == 0)        sp.printItemFooter("", "<a href=\""+Config.context+"/servlet/edu.rice.rubis.beans.servlets.SearchItemsByRegion?category="+categoryId+                           "&region="+regionId+"&page="+(page+1)+"&nbOfItems="+nbOfItems+"\">Next page</a>");      else        sp.printItemFooter("<a href=\""+Config.context+"/servlet/edu.rice.rubis.beans.servlets.SearchItemsByRegion?category="+categoryId+                           "&region="+regionId+"&page="+(page-1)+"&nbOfItems="+nbOfItems+"\">Previous page</a>",                           "<a href=\"/servlet/edu.rice.rubis.beans.servlets.SearchItemsByRegion?category="+categoryId+                           "&region="+regionId+"&page="+(page+1)+"&nbOfItems="+nbOfItems+"\">Next page</a>");    }     catch (Exception e)     {      sp.printHTML("Exception getting item list: " + e +"<br>");    }  }