Use JavaBean to create your online calendar (1) _ MySQL

Source: Internet
Author: User
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. Believe it or not, read the following example: <HTML> <HEAD> <TITLE> perpetual calendar notepad <TITLE> <HEAD> <BODYBGCOLORwhite> some friends on the settings page once said, if you have an online diary or an online calendar, you can just remind yourself 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, "http://www.yesky.com/", "_ 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.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.