FileDocCategorySizeDatePackage
ViewMonthReqHandler.javaAPI DocExample1524Sun Sep 02 14:59:06 BST 2001com.oreilly.forum.servlet

ViewMonthReqHandler

public class ViewMonthReqHandler extends ReqHandler
Handle a request to view a month for a message board.

Fields Summary
Constructors Summary
Methods Summary
protected RendererdoGet(javax.servlet.http.HttpServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

        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);
        }
    
protected java.lang.StringgetPathInfo()

        return "viewMonth";