init
This commit is contained in:
94
webapps/examples/jsp/cal/cal1.jsp
Normal file
94
webapps/examples/jsp/cal/cal1.jsp
Normal file
@@ -0,0 +1,94 @@
|
||||
<%--
|
||||
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.
|
||||
--%>
|
||||
<%@page contentType="text/html; charset=UTF-8" %>
|
||||
<HTML>
|
||||
<HEAD><TITLE>
|
||||
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>
|
||||
|
||||
|
||||
45
webapps/examples/jsp/cal/cal2.jsp
Normal file
45
webapps/examples/jsp/cal/cal2.jsp
Normal file
@@ -0,0 +1,45 @@
|
||||
<%--
|
||||
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.
|
||||
--%>
|
||||
<%@page contentType="text/html; charset=UTF-8" %>
|
||||
<HTML>
|
||||
<HEAD><TITLE>
|
||||
Calendar: A JSP APPLICATION
|
||||
</TITLE></HEAD>
|
||||
|
||||
|
||||
<BODY BGCOLOR="white">
|
||||
<jsp:useBean id="table" scope="session" class="cal.TableBean" />
|
||||
|
||||
<%
|
||||
String time = request.getParameter ("time");
|
||||
%>
|
||||
|
||||
<FONT SIZE=5> Please add the following event:
|
||||
<BR> <h3> Date <%= table.getDate() %>
|
||||
<BR> Time <%= util.HTMLFilter.filter(time) %> </h3>
|
||||
</FONT>
|
||||
<FORM METHOD=POST ACTION=cal1.jsp>
|
||||
<BR>
|
||||
<BR> <INPUT NAME="date" TYPE=HIDDEN VALUE="current">
|
||||
<BR> <INPUT NAME="time" TYPE=HIDDEN VALUE="<%= util.HTMLFilter.filter(time) %>">
|
||||
<BR> <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
|
||||
<BR> <INPUT TYPE=SUBMIT VALUE="submit">
|
||||
</FORM>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
43
webapps/examples/jsp/cal/calendar.html
Normal file
43
webapps/examples/jsp/cal/calendar.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<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>
|
||||
<title>Untitled Document</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF">
|
||||
<p><font color="#0000FF"><a href="login.html"><img src="../images/execute.gif" align="right" border="0"></a><a href="../index.html"><img src="../images/return.gif" width="24" height="24" align="right" border="0"></a></font></p>
|
||||
|
||||
<h2> Source Code for Calendar Example. <br>
|
||||
<h3><a href="cal1.jsp.html">cal1.jsp<font color="#0000FF"></a>
|
||||
</font> </h3>
|
||||
<h3><a href="cal2.jsp.html">cal2.jsp<font color="#0000FF"></a>
|
||||
</font> </h3>
|
||||
|
||||
<br>
|
||||
<h2> Beans.
|
||||
<h3><a href="TableBean.java.html">TableBean<font color="#0000FF"></a>
|
||||
</font> </h3>
|
||||
<h3><a href="Entries.java.html">Entries<font color="#0000FF"></a>
|
||||
</font> </h3>
|
||||
<h3><a href="Entry.java.html">Entry<font color="#0000FF"></a>
|
||||
</font> </h3>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
47
webapps/examples/jsp/cal/login.html
Normal file
47
webapps/examples/jsp/cal/login.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<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>
|
||||
<title> Login page for the calendar. </title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="white">
|
||||
<center>
|
||||
|
||||
<font size=7 color="red"> Please Enter the following information: </font>
|
||||
|
||||
<br>
|
||||
<form method=GET action=cal1.jsp>
|
||||
|
||||
<font size=5> Name <input type=text name="name" size=20>
|
||||
</font>
|
||||
<br>
|
||||
<font size=5> Email <input type=text name="email" size=20>
|
||||
</font>
|
||||
<br>
|
||||
<input type=submit name=action value="Submit">
|
||||
|
||||
</form>
|
||||
<hr>
|
||||
<font size=3 color="red"> Note: This application does not implement the complete
|
||||
functionality of a typical calendar application. It demonstrates a way JSP can
|
||||
be used with html tables and forms.</font>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user