Some friends once said that if there is an online diary or an online calendar, it would be nice to remind you of what to do. In fact, you can also create such a calendar by yourself. Let's look at the example below:
<HTML> 〉
<HEAD> 〉
<TITLE> perpetual calendar notepad </TITLE> 〉
</HEAD> 〉
<Body bgcolor = "white"> "〉
// Set the page scripting language to java. Import the HtmlCalendarNotePad class. HtmlCalendarNotePad will be discussed later.
<% @ Page language = "java" import = "HtmlCalendarNotePad" %> 〉
// Define a JavaBean and set its id to HtmlCal.
<Jsp: useBean id = "HtmlCal" scope = "session" class = "HtmlCalendarNotePad"/> "/〉
<%
// Set the parameter. The required month is January 1, March. Because no year is set, this year is used by default.
HtmlCal. setMonth (3 );
// Set the action. Go to Skynet and open it in a new window (you can also open it in another way) on June 18, March 24)
HtmlCal. setAction (24, "/", "_ blank ");
%> 〉
<Table width = 300> 〉
<TR> <td nowrap> 〉
<% = HtmlCal. getHtml () %> // outputs the calendar of a month in the form of a table.
</TD> </TR> 〉
</TABLE> 〉
</BODY> 〉
</HTML> 〉
You will see the following output results
Mon Tue Wed Thu Fri Sat Sun
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
This is not the same as the calendar, but it is better than the calendar. There is a preset link to remind you to go to a site or execute a javascript function, isn't it another notebook? Of course, you can also add some functions to make it more powerful. For example, adding a form allows users to enter a diary and send it to the database of your system. For this purpose, let's take a look at how the JavaBean program is written.
JavaBean program analysis
I want to introduce some of the main methods in HtmlCalendarNotePad. I believe they will be helpful to you.
Public void setYear (int year) // sets the year. The default value is the current year.
Public int getYear () // Obtain the year. The default value is the current year.
// This is written in a standard Java program. Because a Java program is a class, this setXXX/getXXX is often written.
Public void setMonth (int month) // sets the month (1-12). The default value is the current month.
Public int getMonth () // Obtain the month (1-12). The default value is the current month.
Public void setStyle (int style)
Public int getStyle ()
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service