001 package jsp.cal;
002
003 import javax.servlet.*;
004 import javax.servlet.http.*;
005 import javax.servlet.jsp.*;
006 import cal.*;
007
008 public final class cal1_jsp extends org.apache.jasper.runtime.HttpJspBase
009 implements org.apache.jasper.runtime.JspSourceDependent {
010
011 private static java.util.List _jspx_dependants;
012
013 public Object getDependants() {
014 return _jspx_dependants;
015 }
016
017 public void _jspService(HttpServletRequest request, HttpServletResponse response)
018 throws java.io.IOException, ServletException {
019
020 JspFactory _jspxFactory = null;
021 PageContext pageContext = null;
022 HttpSession session = null;
023 ServletContext application = null;
024 ServletConfig config = null;
025 JspWriter out = null;
026 Object page = this;
027 JspWriter _jspx_out = null;
028 PageContext _jspx_page_context = null;
029
030
031 try {
032 _jspxFactory = JspFactory.getDefaultFactory();
033 response.setContentType("text/html");
034 pageContext = _jspxFactory.getPageContext(this, request, response,
035 null, true, 8192, true);
036 _jspx_page_context = pageContext;
037 application = pageContext.getServletContext();
038 config = pageContext.getServletConfig();
039 session = pageContext.getSession();
040 out = pageContext.getOut();
041 _jspx_out = out;
042
043 out.write("<HTML>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one or more\n contributor license agreements. See the NOTICE file distributed with\n this work for additional information regarding copyright ownership.\n The ASF licenses this file to You under the Apache License, Version 2.0\n (the \"License\"); you may not use this file except in compliance with\n the License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<HEAD><TITLE> \n\tCalendar: A JSP APPLICATION\n</TITLE></HEAD>\n\n\n<BODY BGCOLOR=\"white\">\n\n\n");
044 cal.TableBean table = null;
045 synchronized (session) {
046 table = (cal.TableBean) _jspx_page_context.getAttribute("table", PageContext.SESSION_SCOPE);
047 if (table == null){
048 table = new cal.TableBean();
049 _jspx_page_context.setAttribute("table", table, PageContext.SESSION_SCOPE);
050 }
051 }
052 out.write('\n');
053 out.write('\n');
054
055 table.processRequest(request);
056 if (table.getProcessError() == false) {
057
058 out.write("\n\n<!-- html table goes here -->\n<CENTER>\n<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>\n<TR>\n<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=prev> prev </A>\n<TD ALIGN=CENTER> Calendar:");
059 out.print( table.getDate() );
060 out.write("</TD>\n<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=next> next </A>\n</TR>\n</TABLE>\n\n<!-- the main table -->\n<TABLE WIDTH=60% BGCOLOR=lightblue BORDER=1 CELLPADDING=10>\n<TR>\n<TH> Time </TH>\n<TH> Appointment </TH>\n</TR>\n<FORM METHOD=POST ACTION=cal1.jsp>\n");
061
062 for(int i=0; i<table.getEntries().getRows(); i++) {
063 cal.Entry entr = table.getEntries().getEntry(i);
064
065 out.write("\n\t<TR>\n\t<TD> \n\t<A HREF=cal2.jsp?time=");
066 out.print( entr.getHour() );
067 out.write(">\n\t\t");
068 out.print( entr.getHour() );
069 out.write(" </A>\n\t</TD>\n\t<TD BGCOLOR=");
070 out.print( entr.getColor() );
071 out.write('>');
072 out.write('\n');
073 out.write(' ');
074 out.print(util.HTMLFilter.filter(entr.getDescription()));
075 out.write("\n\t</TD> \n\t</TR>\n");
076
077 }
078
079 out.write("\n</FORM>\n</TABLE>\n<BR>\n\n<!-- footer -->\n<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>\n<TR>\n<TD ALIGN=CENTER> ");
080 out.print(util.HTMLFilter.filter(table.getName()));
081 out.write(" : \n\t\t ");
082 out.print(util.HTMLFilter.filter(table.getEmail()));
083 out.write(" </TD>\n</TR>\n</TABLE>\n</CENTER>\n\n");
084
085 } else {
086
087 out.write("\n<font size=5>\n\tYou must enter your name and email address correctly.\n</font>\n");
088
089 }
090
091 out.write("\n\n\n</BODY>\n</HTML>\n\n\n\n\n");
092 } catch (Throwable t) {
093 if (!(t instanceof SkipPageException)){
094 out = _jspx_out;
095 if (out != null && out.getBufferSize() != 0)
096 out.clearBuffer();
097 if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
098 }
099 } finally {
100 if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
101 }
102 }
103 }