sp.printHTML("Cannot get initial context for JNDI: " + e+"<br>"); sp.printHTMLfooter();
printError("Cannot get initial context for JNDI: " + e+"<br>");
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException  {    String  value = request.getParameter("userId");    Integer userId;        sp = new ServletPrinter(response, "ViewUserInfo");    if ((value == null) || (value.equals("")))    {      sp.printHTMLheader("RUBiS ERROR: View user information");      sp.printHTML("<h3>You must provide a user identifier !<br></h3>");      sp.printHTMLfooter();      return ;    }    else      userId = new Integer(value);    sp.printHTMLheader("RUBiS: View user information");    try    {      initialContext = new InitialContext();    }     catch (Exception e)     {      sp.printHTML("Cannot get initial context for JNDI: " + e+"<br>");      sp.printHTMLfooter();      return ;    }    SB_ViewUserInfoHome viewUserInfoHome = null;    SB_ViewUserInfo viewUserInfo = null;    String html;    try     {      viewUserInfoHome = (SB_ViewUserInfoHome)PortableRemoteObject.narrow(initialContext.lookup("SB_ViewUserInfoHome"),                                                       SB_ViewUserInfoHome.class);      viewUserInfo = viewUserInfoHome.create();    }     catch (Exception e)    {      printError("Cannot lookup SB_ViewUserInfo: " +e+"<br>");      return ;    }    try    {      html = viewUserInfo.getUserInfo(userId);      sp.printHTML(html);      sp.printHTMLfooter();    }    catch (Exception e)    {      printError("Cannot get user description (got exception: " +e+")<br>");      return ;    }  }