public void generateView(HttpServletRequest request,
            HttpServletResponse response)
            throws IOException {
        
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        
        out.println("<html><body><p><b><h3>It is a dynamically configured soccer league form</b></h3></p></br></br>");
        
        // Retrieve the errorMsgs from the request-scope
        List errorMsgs = (List) request.getAttribute("errorMsgs");
        
        // Generate error if present
        if(errorMsgs != null){
        out.println("<p>");
        out.println("<font color='red'>Please correct the following errors:");
        out.println("<ul>");
        Iterator items = errorMsgs.iterator();
        while ( items.hasNext() ) {
            String message = (String) items.next();
            out.println("  <li>" + message + "</li>");
        }
        out.println("</ul>");
        out.println("Try again.");
        out.println("</font>");
        out.println("</p></br></br>");
        }
        
        //Generate Form
        out.println("<form action='AddLeague2Servlet' method='POST'>");
        
        //Display year field
        //Repopulate year field
        String year = request.getParameter("year");
        if( year== null){
            year = "";
        }
        out.println("Year:<input type='text' name='year' value='"+ year + "'/> </br></br>");
        
        
        //Customize season drop-down menu & repopulate the list
        String season = request.getParameter("season");
        
        out.println("Season: <select name='season'>");
        if( season==null || season.equals("UNKNOWN"))
        {
        out.println("<option value='UNKNOWN'>select...</option>");
        }
        for( int i=0; i< SEASONS.length; i++){
            out.println("<option value='"+SEASONS[i]+"'");
            if( SEASONS[i].equals(season)){
                out.print("selected");
            }
            out.println(">"+SEASONS[i]+"</option>");
        }
        out.println("</select></br></br>");
        
        //Display Title field
        out.println("Title: <input type='text' name='title' /> <br/><br/>");
        out.println("<input type='submit' value='Add League' />");
        
        out.println("</form></body></html>");
}