Use JavaBean to create your online calendar this (1) _jsp programming

Source: Internet
Author: User
Some friends have said that if there is an online diary, or an online calendar can remind themselves to do things on the good. Actually, you can do one of these calendars yourself. I don't believe you. See the following example:

〈html〉
〈head〉
〈title〉 million Calendar Notepad 〈/title〉
〈/head〉
〈body bgcolor = "white"
Set page scripting language is Java, import Htmlcalendarnotepad class, Htmlcalendarnotepad in the following will be mentioned
〈%@ page language= "java" import= "Htmlcalendarnotepad"%〉
Define a JavaBean whose ID is htmlcal
〈jsp:usebean id= "Htmlcal" scope= "session" class= "Htmlcalendarnotepad"/〉
〈%
Set the parameters, take the required month for March, because the year is not set, so the default for this year.
Htmlcal.setmonth (3);
Set action, March 24, go to Tenkine, open in a new window (or you can open it in a different way)
Htmlcal.setaction ("http://www.yesky.com/", "_blank");
%〉
〈table width=300〉
〈TR〉〈TD nowrap〉
〈%=htmlcal.gethtml ()%〉//prints a one month calendar in tabular form
〈/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

Isn't that the same as the calendar, but it's better than the calendar, with a preset link to remind you to go to a site, or to execute a JavaScript function, so you don't have a notepad anymore? Of course, you can also add some features to make it more powerful, such as adding a form, allowing users to fill in the diary sent to your system's database and so on. To accomplish this, 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.