import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.Calendar; public class NewSchedule2 extends HttpServlet{ public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException{ res.setContentType("text/html;charset=Shift_Jis"); PrintWriter out = res.getWriter(); int year; int month; int day; String param = req.getParameter("YEAR"); if (param == null || param.length() == 0){ year = -999; }else{ try{ year = Integer.parseInt(param); }catch (NumberFormatException e){ year = -999; } } param = req.getParameter("MONTH"); if (param == null || param.length() == 0){ month = -999; }else{ try{ month = Integer.parseInt(param); }catch (NumberFormatException e){ month = -999; } } param = req.getParameter("DAY"); if (param == null || param.length() == 0){ day = -999; }else{ try{ day = Integer.parseInt(param); }catch (NumberFormatException e){ day = -999; } } /* パラメータが指定されていない場合は本日の日付を設定 */ if (year == -999 || month == -999 || day == -999){ Calendar calendar = Calendar.getInstance(); year = calendar.get(Calendar.YEAR); month = calendar.get(Calendar.MONTH); day = calendar.get(Calendar.DATE); } StringBuffer sb = new StringBuffer(); sb.append(""); sb.append(""); sb.append("
"); sb.append(""); sb.append(""); sb.append("スケジュール登録 "); sb.append("[カレンダーへ戻る]"); sb.append("
"); sb.append("時刻 | 予定 |
00:00 | |
01:00 | |
02:00 | |
03:00 | |
04:00 | |
05:00 | |
06:00 | |
07:00 | |
08:00 | |
09:00 | |
10:00 | |
11:00 | |
12:00 | |
13:00 | |
14:00 | |
15:00 | |
16:00 | |
17:00 | |
18:00 | |
19:00 | |
20:00 | |
21:00 | |
22:00 | |
23:00 | |