MY mENU


Tuesday 29 May 2012

Create a drive menu for My Computer


Windows XP makes it easy for you to configure My Computer so it works like a menu, with
each drive listed as a menu item. Here's how. Right-click the Start button, and select Properties.Click Customize, which is adjacent to the Start Menu radio button, and select Advanced. Scroll through the Start Menu Items list box until you see My Computer. Select Display As A Menu, and click OK twice. Now, when you select My Computer from the Start menu, you'll see a menu of individual drives. To access the contents of that drive, just select the drive letter from the menu

Formatting date with fmt:formatDate Action


Date and time are important matters in internationalized web applications. Different country has it own way to present date and time in different format. JSP has an action called to allow you to format date and time based on a specificlocale. Here is a table of action attributes. As you can see only value attribute isrequired for action.

Date and time are important matters in internationalized web applications. Different country has it own way to present date and time in different format.  JSP has an action called  to allow you to format date and time based on a specificlocale. Here is a table of action attributes. As you can see only value attribute is required for action.
Attributes
NameMandatoryMeaning
valueyesDate and/or time value to be formatted.
typenoAccept date or/and time to be used to format
dateStylenoSpecify predefined formatted style for date only if date value is used for formatting.
timeStylenoSpecify predefined formatted style for time only if time value is used for formatting.
patternnoSpecify standard customized pattern for formating date and/or time
timeZonenoIf the time value is used to format, this attribute specify time zone for that time value.
varnoThis attribute is for exporting scoped  variable which stores the formatted date and/or time as a string
scopenospecify the scope of var.

Let's take a look at an example of using  action to format date in different locale.
First we use the useBean tag to initialize a scoped variable called now and store current date value into this variable. Then we set the locale to different locales: US and FR and print out the current date in now variable by using  action.

Formatting Date and/or Time

By default format and print only date. If you want to print time or bothdate and time you can use the type attribute. The type attribute accepts date, time and both to allow you to print such a this information in a specific locale. Let's take a look at an example:
Formatting Date Time with predefined styles and custom patterns
You cannot only format and print date & time with predefined styles provided by JSTL but also with a custom pattern. The timeStyle and dateStyle attributes of specify the predefined styles you want to format. Patterns attribute enables you to define your own style. In this case, you need the date & time code table bellow to find exactly what you want to format.
CodeMeaning
GThe era (A.D., B.C., and so on)
yThe year (yy for two-digit years, yyyy for four digits)
MThe month (MM for numeric month, MMM or longer for month names orabbreviations)
wThe week of the year (ww for two digits)
WThe week of the month
DThe day of the year (DDD for three digits)
dThe day of the month (dd for two digits)
FThe numeric day of the week
EThe text day of the week (EEEE or longer for full name)
aAMa.m./PMp.m. indicator
HHour of the day (0–23)
kHour of the day (1–24)
KHour in a.m./p.m. (0–11)
hHour in a.m./p.m. (1–12)
mMinutes in hour
sSeconds in minute
SMilliseconds in second
zFull time zone name
ZRFC 822 time zone (for example, 0500)
Here is an example of using predefined styles and custom pattern to format and print date & time.