}
public YearMonth createBeanFromRequest(HttpServletRequest request) {
String year = (String) getFromRequest(request, "year");
String month = (String) getFromRequest(request, "month");
YearMonth yearMonthBean;
if (StringUtils.isEmpty(year)) {
yearMonthBean = new YearMonth(Calendar.getInstance().get(Calendar.YEAR), null);
} else if (StringUtils.isEmpty(month)) {
yearMonthBean = new YearMonth(Integer.valueOf(year), null);
} else {
yearMonthBean = new YearMonth(Integer.valueOf(year), Integer.valueOf(month));
}
yearMonthBean.setFirstYear(FIRST_YEAR_TO_SHOW_ARCHIVE_MESSAGES_FROM);
return yearMonthBean;
}