try {
DataAdapter adapter = DataAdapter.getInstance();
// these are all required parameters
long boardID = 0L;
int month = 0;
int year = 0;
try {
boardID = Long.parseLong(request.getParameter("boardID"));
month = Integer.parseInt(request.getParameter("month"));
year = Integer.parseInt(request.getParameter("year"));
} catch (Exception ex) {
return new ErrorRenderer("Invalid request");
}
BoardSummary board = adapter.getBoardSummary(boardID);
if (board == null) {
return new ErrorRenderer("Invalid request");
}
return new ViewMonthRenderer(board, new MonthYear(month, year));
} catch (DataException de) {
return new ErrorRenderer(de);
}