| [66] | 1 | <html><body><pre> | 
|---|
|  | 2 | <HTML> | 
|---|
|  | 3 | <!-- | 
|---|
|  | 4 | Licensed to the Apache Software Foundation (ASF) under one or more | 
|---|
|  | 5 | contributor license agreements.  See the NOTICE file distributed with | 
|---|
|  | 6 | this work for additional information regarding copyright ownership. | 
|---|
|  | 7 | The ASF licenses this file to You under the Apache License, Version 2.0 | 
|---|
|  | 8 | (the "License"); you may not use this file except in compliance with | 
|---|
|  | 9 | the License.  You may obtain a copy of the License at | 
|---|
|  | 10 |  | 
|---|
|  | 11 | http://www.apache.org/licenses/LICENSE-2.0 | 
|---|
|  | 12 |  | 
|---|
|  | 13 | Unless required by applicable law or agreed to in writing, software | 
|---|
|  | 14 | distributed under the License is distributed on an "AS IS" BASIS, | 
|---|
|  | 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|---|
|  | 16 | See the License for the specific language governing permissions and | 
|---|
|  | 17 | limitations under the License. | 
|---|
|  | 18 | --> | 
|---|
|  | 19 | <HEAD><TITLE> | 
|---|
|  | 20 | Calendar: A JSP APPLICATION | 
|---|
|  | 21 | </TITLE></HEAD> | 
|---|
|  | 22 |  | 
|---|
|  | 23 |  | 
|---|
|  | 24 | <BODY BGCOLOR="white"> | 
|---|
|  | 25 |  | 
|---|
|  | 26 | <%@ page language="java" import="cal.*" %> | 
|---|
|  | 27 | <jsp:useBean id="table" scope="session" class="cal.TableBean" /> | 
|---|
|  | 28 |  | 
|---|
|  | 29 | <% | 
|---|
|  | 30 | table.processRequest(request); | 
|---|
|  | 31 | if (table.getProcessError() == false) { | 
|---|
|  | 32 | %> | 
|---|
|  | 33 |  | 
|---|
|  | 34 | <!-- html table goes here --> | 
|---|
|  | 35 | <CENTER> | 
|---|
|  | 36 | <TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15> | 
|---|
|  | 37 | <TR> | 
|---|
|  | 38 | <TD ALIGN=CENTER> <A HREF=cal1.jsp?date=prev> prev </A> | 
|---|
|  | 39 | <TD ALIGN=CENTER> Calendar:<%= table.getDate() %></TD> | 
|---|
|  | 40 | <TD ALIGN=CENTER> <A HREF=cal1.jsp?date=next> next </A> | 
|---|
|  | 41 | </TR> | 
|---|
|  | 42 | </TABLE> | 
|---|
|  | 43 |  | 
|---|
|  | 44 | <!-- the main table --> | 
|---|
|  | 45 | <TABLE WIDTH=60% BGCOLOR=lightblue BORDER=1 CELLPADDING=10> | 
|---|
|  | 46 | <TR> | 
|---|
|  | 47 | <TH> Time </TH> | 
|---|
|  | 48 | <TH> Appointment </TH> | 
|---|
|  | 49 | </TR> | 
|---|
|  | 50 | <FORM METHOD=POST ACTION=cal1.jsp> | 
|---|
|  | 51 | <% | 
|---|
|  | 52 | for(int i=0; i<table.getEntries().getRows(); i++) { | 
|---|
|  | 53 | cal.Entry entr = table.getEntries().getEntry(i); | 
|---|
|  | 54 | %> | 
|---|
|  | 55 | <TR> | 
|---|
|  | 56 | <TD> | 
|---|
|  | 57 | <A HREF=cal2.jsp?time=<%= entr.getHour() %>> | 
|---|
|  | 58 | <%= entr.getHour() %> </A> | 
|---|
|  | 59 | </TD> | 
|---|
|  | 60 | <TD BGCOLOR=<%= entr.getColor() %>> | 
|---|
|  | 61 | <% out.print(util.HTMLFilter.filter(entr.getDescription())); %> | 
|---|
|  | 62 | </TD> | 
|---|
|  | 63 | </TR> | 
|---|
|  | 64 | <% | 
|---|
|  | 65 | } | 
|---|
|  | 66 | %> | 
|---|
|  | 67 | </FORM> | 
|---|
|  | 68 | </TABLE> | 
|---|
|  | 69 | <BR> | 
|---|
|  | 70 |  | 
|---|
|  | 71 | <!-- footer --> | 
|---|
|  | 72 | <TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15> | 
|---|
|  | 73 | <TR> | 
|---|
|  | 74 | <TD ALIGN=CENTER>  <% out.print(util.HTMLFilter.filter(table.getName())); %> : | 
|---|
|  | 75 | <% out.print(util.HTMLFilter.filter(table.getEmail())); %> </TD> | 
|---|
|  | 76 | </TR> | 
|---|
|  | 77 | </TABLE> | 
|---|
|  | 78 | </CENTER> | 
|---|
|  | 79 |  | 
|---|
|  | 80 | <% | 
|---|
|  | 81 | } else { | 
|---|
|  | 82 | %> | 
|---|
|  | 83 | <font size=5> | 
|---|
|  | 84 | You must enter your name and email address correctly. | 
|---|
|  | 85 | </font> | 
|---|
|  | 86 | <% | 
|---|
|  | 87 | } | 
|---|
|  | 88 | %> | 
|---|
|  | 89 |  | 
|---|
|  | 90 |  | 
|---|
|  | 91 | </BODY> | 
|---|
|  | 92 | </HTML> | 
|---|
|  | 93 |  | 
|---|
|  | 94 |  | 
|---|
|  | 95 |  | 
|---|
|  | 96 |  | 
|---|
|  | 97 | </pre></body></html> | 
|---|