Archive for March, 2010

Get month name from Calendar.MONTH field

Here’s a method to get the month name from the Calendar.MONTH field:

public String getMonthFromInt(int iMonth) {
String month = "invalid";
DateFormatSymbols dfs = new DateFormatSymbols();
String[] months = dfs.getMonths();
if (iMonth >= 0 && iMonth <= 11)
month = months[iMonth];
return month;
}

Displaytag library in your portlet

These are – roughly – the steps that you need to follow if you are planing to use the displaytag library in your portlet.