public String getCommentForm(Integer itemId, Integer toId, String username, String password)
public String getCommentForm(Integer itemId, Integer toId, String username, String password) throws RemoteException
  public String getCommentForm(Integer itemId, Integer toId, String username, String password)   {    int userId = -1;    String html = "";    UserHome uHome;    ItemHome iHome;    // Authenticate the user who want to comment      if ((username != null && username !="") || (password != null && password !=""))      {        SB_AuthHome authHome = null;        SB_Auth auth = null;        try         {          authHome = (SB_AuthHome)PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/SB_Auth"), SB_AuthHome.class);          auth = authHome.create();        }         catch (Exception e)        {          throw new EJBException("Cannot lookup SB_Auth: " +e);        }        try         {          userId = auth.authenticate(username, password);        }         catch (Exception e)        {          throw new EJBException("Authentication failed: " +e);        }        if (userId == -1)        {           html = (" You don't have an account on RUBiS!<br>You have to register first.<br>");           return html;        }      }    // Try to find the user corresponding to the 'to' ID    try     {      uHome = (UserHome)PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/User"),                                                    UserHome.class);      iHome = (ItemHome)PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/Item"),                                                    ItemHome.class);    }     catch (Exception e)    {      throw new EJBException("Cannot lookup User or Item: " +e+"<br>");    }    try    {      User    to = uHome.findByPrimaryKey(new UserPK(toId));      Item    item = iHome.findByPrimaryKey(new ItemPK(itemId));      String  toName = to.getNickName();      html = "<center><h2>Give feedback about your experience with "+toName+"</h2><br>\n";      html = html.concat("<form action=\"/servlet/edu.rice.rubis.beans.servlets.StoreComment\" method=POST>\n"+                   "<input type=hidden name=to value="+toId.intValue()+">\n"+                   "<input type=hidden name=from value="+userId+">\n"+                   "<input type=hidden name=itemId value="+itemId.intValue()+">\n"+                   "<center><table>\n"+                   "<tr><td><b>From</b><td>"+username+"\n"+                   "<tr><td><b>To</b><td>"+toName+"\n"+                         "<tr><td><b>About item</b><td>"+item.getName()+"\n");    }    catch (Exception e)    {      throw new EJBException("Cannot build comment form: " +e);    }    return html;  }