sp.printHTML("Cannot lookup SB_RegisterUser: " +e+"<br>");
printError("Cannot lookup SB_RegisterUser: " +e+"<br>");
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException  {    String firstname=null, lastname=null, nickname=null, email=null, password=null;    int    regionId = 0;    int    userId;    String creationDate, regionName;    sp = new ServletPrinter(response, "RegisterUser");          Context initialContext = null;    try    {      initialContext = new InitialContext();    }     catch (Exception e)     {      printError("Cannot get initial context for JNDI: " + e+"<br>");      return ;    }    String value = request.getParameter("firstname");    if ((value == null) || (value.equals("")))    {      printError("You must provide a first name!<br>");      return ;    }    else      firstname = value;    value = request.getParameter("lastname");    if ((value == null) || (value.equals("")))    {      printError("You must provide a last name!<br>");      return ;    }    else      lastname = value;    value = request.getParameter("nickname");    if ((value == null) || (value.equals("")))    {      printError("You must provide a nick name!<br>");      return ;    }    else      nickname = value;    value = request.getParameter("email");    if ((value == null) || (value.equals("")))    {      printError("You must provide an email address!<br>");      return ;    }    else      email = value;    value = request.getParameter("password");    if ((value == null) || (value.equals("")))    {      printError("You must provide a password!<br>");      return ;    }    else      password = value;    value = request.getParameter("region");    if ((value == null) || (value.equals("")))    {      printError("You must provide a valid region!<br>");      return ;    }    else      regionName = value;    // Try to create a new user    SB_RegisterUserHome regHome;    SB_RegisterUser reg;    try     {      regHome = (SB_RegisterUserHome)PortableRemoteObject.narrow(initialContext.lookup("SB_RegisterUserHome"),                                                     SB_RegisterUserHome.class);     reg = regHome.create();    }     catch (Exception e)    {      sp.printHTML("Cannot lookup SB_RegisterUser: " +e+"<br>");      return ;    }    String html;    try    {      sp.printHTMLheader("RUBiS: Welcome to "+nickname);      html = reg.createUser(firstname, lastname, nickname, email, password, regionName);            sp.printHTML("<h2>Your registration has been processed successfully</h2><br>\n");      sp.printHTML("<h3>Welcome "+nickname+"</h3>\n");      sp.printHTML("RUBiS has stored the following information about you:<br>\n");      sp.printHTML("First Name : "+firstname+"<br>\n");      sp.printHTML("Last Name  : "+lastname+"<br>\n");      sp.printHTML("Nick Name  : "+nickname+"<br>\n");      sp.printHTML("Email      : "+email+"<br>\n");      sp.printHTML("Password   : "+password+"<br>\n");      sp.printHTML("Region     : "+regionName+"<br>\n");      sp.printHTML("<br>The following information has been automatically generated by RUBiS:<br>\n");      sp.printHTML(html);      sp.printHTMLfooter();    }     catch (Exception e)    {      sp.printHTML("User registration failed: " +e+"<br>");    }  }