Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
82
Chapter 3 Handling the Client Request: Form Data
Listing 3.6 SubmitResume.java (continued)
  // Given "Java,C++,Lisp", "Java C++ Lisp" or
  // "Java, C++, Lisp", returns
  // "
  //   
  • Java
  •   //   
  • C++
  •   //   
  • Lisp
  •   //  "
      private String makeList(String listItems) {
        StringTokenizer tokenizer =
          new StringTokenizer(listItems, ", ");
        String list = "
        while(tokenizer.hasMoreTokens()) {
          list = list + "  
  • " + tokenizer.nextToken() + "\n";
  •     }
        list = list + "";
        return(list);
      }
      // Show a confirmation page when they press the
      // "Submit" button.
      
      private void showConfirmation(HttpServletRequest request,
                                    PrintWriter out) {
        String title = "Submission Confirmed.";
        out.println(ServletUtilities.headWithTitle(title) +
                    "\n" +
                    "

    " + title + "

    \n" +
                    "Your resume should appear on line within\n" +
                    "24 hours. If it doesn't, try submitting\n" +
                    "again with a different email address.\n" +
                    "");
      }
      // Why it is bad to give your email address to untrusted sites
      
      private void storeResume(HttpServletRequest request) {
        String email = request.getParameter("email");
        putInSpamList(email);
      }
      
      private void putInSpamList(String emailAddress) {
        // Code removed to protect the guilty.
      }
    }
    Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
    Servlet and JSP training courses by book's author: courses.coreservlets.com.
    
    
    
    
    
    
    footer
    
    
    
    
    

     

     

     

     

     Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

    jsp web hosting

     

    Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

    Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved