/Users/lyon/j4p/src/net/server/servlets/SelectCoursePage.java

1    package net.server.servlets; 
2     
3     
4    /** 
5     * The SelectCoursePage class is a type of HTML page 
6     * which is used to prompt a user to select a course id. 
7     * 
8     * @author Robert Lysik 
9     * @version 1.00 
10    */ 
11   class SelectCoursePage extends net.server.servlets.HtmlPage { 
12    
13       /** 
14        * This is the default constructor for the 
15        * SelectCoursePage class. The parent constructor 
16        * is caller with the page title, 'Course Selection Page'. 
17        * A form is added to the page which is used to prompt 
18        * the user to select a course id from a drop down list. 
19        * The form data is passed to the FormProcessorServlet 
20        * class when the user clicks 'Enter'. 
21        */ 
22       SelectCoursePage(String[] courseIds, Course[] courses) { 
23           super("Course Selection Page"); 
24    
25           addText("Select a course ID from the following list:"); 
26           startForm("get", 
27                   "http://localhost:8080/examples/servlet/FormProcessorServlet"); 
28           addBreak(); 
29           addText(getSelect("course", "1", courseIds, courseIds)); 
30           addBreak(); 
31           addSubmit("Enter"); 
32           addHidden("status", "course_id_selected"); 
33           endForm(); 
34       } 
35   }