alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Tomcat example source code file (cal1.jsp)

This example Tomcat source code file (cal1.jsp) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Tomcat tags/keywords

a, a, align=center, form, license, license, table, td, td, th, tr, tr, width=60, you

The Tomcat cal1.jsp source code

<HTML>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<HEAD> 
	Calendar: A JSP APPLICATION
</TITLE></HEAD>


<BODY BGCOLOR="white">

<%@ page language="java" import="cal.*" %>
<jsp:useBean id="table" scope="session" class="cal.TableBean" />

<%
	table.processRequest(request);
	if (table.getProcessError() == false) {
%>

<!-- html table goes here -->
<CENTER>
<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
<TR>
<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=prev> prev </A>
<TD ALIGN=CENTER> Calendar:<%= table.getDate() %></TD>
<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=next> next </A>
</TR>
</TABLE>

<!-- the main table -->
<TABLE WIDTH=60% BGCOLOR=lightblue BORDER=1 CELLPADDING=10>
<TR>
<TH> Time </TH>
<TH> Appointment </TH>
</TR>
<FORM METHOD=POST ACTION=cal1.jsp>
<%
	for(int i=0; i<table.getEntries().getRows(); i++) {
	   cal.Entry entr = table.getEntries().getEntry(i);	
%>
	<TR>
	<TD> 
	<A HREF=cal2.jsp?time=<%= entr.getHour() %>>
		<%= entr.getHour() %> </A>
	</TD>
	<TD BGCOLOR=<%= entr.getColor() %>>
	<% out.print(util.HTMLFilter.filter(entr.getDescription())); %>
	</TD> 
	</TR>
<%
	}
%>
</FORM>
</TABLE>
<BR>

<!-- footer -->
<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
<TR>
<TD ALIGN=CENTER>  <% out.print(util.HTMLFilter.filter(table.getName())); %> : 
		     <% out.print(util.HTMLFilter.filter(table.getEmail())); %> </TD>
</TR>
</TABLE>
</CENTER>

<%
	} else {
%>
<font size=5>
	You must enter your name and email address correctly.
</font>
<%
	}
%>


</BODY>
</HTML>




</pre>
<div id="after_source_code">
<h2>Other Tomcat examples (source code examples)</h2>
<p>Here is a short list of links related to this Tomcat cal1.jsp source code file:</p>
<ul>
  <li><a href="/java/jwarehouse"><img src="/images/scw/find.png" border="0"> The search page</a></li>
  <li><a href="index.shtml"><img src="/images/scw/folder.png" border="0"> Other Tomcat source code examples at this package level</a></li>
  <li><a href="/java/jwarehouse/about.shtml"><img src="/images/scw/information.png" border="0"> Click here to learn more about this project</a></li>
</ul>
</div>
</td>
</tr>
</table>
</div>
</div>

<div style="padding-top: 1em; width: 310px; margin-left: auto; margin-right: auto; table {border-collapse: collapse; border: none;}; tr {border-collapse: collapse; border: none; text-align: center;};">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
      <td colspan="2" style="border-collapse: collapse; border: none; text-align: center;};">
        <em>... this post is sponsored by my books ...</em>
      </td>
  </tr>
  <tr>
      <td width="150" style="border-collapse: collapse; border: none; text-align: center;};">
        <a href="https://kbhr.co/ckbk-v2"><img
           src="/images/books/scala-cookbook-v2-cover-220h.jpg"
           title="The Scala Cookbook, by Alvin Alexander" height="220" />
           <br /><span style="opacity: 0.4;">#1 New Release!</span></a>
      </td>
      <td width="150" style="border-collapse: collapse; border: none; text-align: center; padding-left: 8px;">
        <a href="http://kbhr.co/fps-book"><img
           src="/images/books/functional-programming-simplified-small.jpg"
           title="Functional Programming, Simplified, by Alvin Alexander"
           height="220" />
           <br /><span style="opacity: 0.4;">FP Best Seller</span></a>
      </td>
  </tr>
</table>
<p> </p>
</div>


<div id="whats_new">
<h2>new blog posts</h2>
<div id="whats_new_list">
<ul>
<li><a class="whats_new_link" href="/java/java-current-date-example-now">Java: How to get the current date (and time) in Java 8, 11, 14, 17, etc.</a></li>
<li><a class="whats_new_link" href="/photos/impossible-risky-give-it-try">Impossible ... risky ... give it a try</a></li>
<li><a class="whats_new_link" href="/scala/learn-functional-programming-book">Book: Learn Functional Programming The Fast Way! (FP for OOP developers)</a></li>
<br/>
<li><a class="whats_new_link" href="/personal/ram-dass-glossary-terms-maharaji-yoga">A glossary of terms related to Ram Dass, Maharaj-ji, yoga, Zen, Buddhism, and more</a></li>
<li><a class="whats_new_link" href="/personal/song-lyrics-what-do-you-think-about-when-you-think-about-me">Song lyrics: What do you think about when you think about me?</a></li>
<li><a class="whats_new_link" href="/source-code/scala-how-use-zio-2-in-ammonite-repl">How to use ZIO 2 in the Ammonite REPL</a></li>
<br/>
<li><a class="whats_new_link" href="/photos/pain-is-doorway-bone-marrow-biopsy">Pain is the Doorway: A story in two images</a></li>
<li><a class="whats_new_link" href="/misc/daily-stoic-discipline-now-freedom-later-odyssey-sirens-story">Daily Stoic story: Discipline Now, Freedom Later</a></li>
<li><a class="whats_new_link" href="/misc/if-youre-falling-asleep-someone-gets-in-bed-with-you-hallucinations">If you'''re falling asleep and someone or some thing gets in bed with you ...</a></li>
<br/>
<br/>
</div>
</ul>
</div>


<p> </p>

<p align="center"><font color="#000000" size="2"
face="Verdana,Arial">Copyright 1998-2021 Alvin Alexander, alvinalexander.com<br/>
All Rights Reserved.<br/>
<br/>
A percentage of advertising revenue from<br/>
pages under the <a href="/java/jwarehouse">/java/jwarehouse</a> 
URI on this website is<br/>
paid back to open source projects.</p>


<script>
shuffle(books);
var div = document.getElementById("leftcol");
var pre = '<div style="margin: 0; padding-right: 1.6em"><h2 align="center">favorite books</h2>';
var post = '</div>';
if (adblock) {
  var str = books.slice(0,3).join(" ");
  div.insertAdjacentHTML('beforeend', pre + str + post);
} else {
  var str = books.slice(0,1).join(" ");
  div.insertAdjacentHTML('beforeend', pre + str + post);
}
</script>



<p style="padding-bottom: 80px;"> </p>


</body>