Calendarクラス

		Calendar cal1 = Calendar.getInstance();
	    cal1.set(Calendar.MONTH, 1);

	    int month = cal1.get(Calendar.MONTH);
	    int month2 = Calendar.MONTH;

	    System.out.println(month);
	    System.out.println(month2);

 

result:

1

2

逐句分析这段代码<%@page import="java.util.Date"%> <%@page import="java.text.SimpleDateFormat"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.PreparedStatement"%> <%@ page import="jp.co.canon_soft.wp.runtime.AppContext"%> <%@ page import="java.text.SimpleDateFormat, java.util.Date, java.util.Locale, java.util.Calendar" %> <%@ page contentType="text/html; charset=Windows-31J" import="org.apache.commons.lang.*" import="jakarta.servlet.http.HttpSession" import="jp.co.canon_soft.wp.runtime.util.*" import="filter.Certification" import="security.LoginCheck" import="java.util.*" import="util.StringUtil" %> <%!private static final int MSGTYPE_UNKNOWN = 0; private static final int MSGTYPE_INFO = 1; private static final int MSGTYPE_WARN = 2; private static final int MSGTYPE_ERR = 3; String msg = ""; int msgType = MSGTYPE_UNKNOWN; String focusFieldName = "user"; private boolean doLogin(HttpSession ses, String userid, String pass) { System.out.println("@@@@@doLogin: "+ses); Certification cer = new Certification(); return cer.certificateByAD(ses, userid, pass); }%><% String strLoginMode = (String)request.getAttribute("LOGIN_MODE"); if( strLoginMode == null ) strLoginMode = "LOGIN" ; String strWpkey = (String)request.getAttribute("WPKEY"); if( strWpkey == null ) strWpkey = "" ; String msg = (String)request.getAttribute("LOGIN_MSG"); if( msg == null ) msg = "" ; String ctxPath = request.getContextPath(); String pAction = request.getParameter("action"); String userid = request.getParameter("user"); String pass = request.getParameter("password"); /* if(StringUtils.equals(pAction, "dologin")) { List<Object> result = LoginCheck.loginCheck(userid, pass); String message = StringUtil.toString(result.get(0)); HttpSession ses = request.getSession(true); System.out.println("@@@@@@@ "+ses); if (userid == null || userid.equals("")) { msg = "ユーザIDは必須です。"; msgType = 3; focusFieldName = "user"; } else if (pass == null || pass.equals("")) { msg = "パスワードは必須です。"; msgType = 3; focusFieldName = "password"; } else if (message != null && !"".equals(message)) { msg = message; msgType = 3; focusFieldName = "user"; } else { if(doLogin(ses, userid, pass)) { ses.setAttribute("APP_ISLOGGEDIN",new Boolean(true)); ses.setAttribute("APP_USER",userid); ses.setAttribute("APP_PASS",pass); Date lastLoginTime = (Date)result.get(1); ses.setAttribute("sysLastLoginDateTime",lastLoginTime); response.sendRedirect( ctxPath + "/"); } else { msg = "ユーザIDまたはパスワードが違います。"; msgType = 3; focusFieldName = "user"; } } } */ %> <!DOCTYPE html> <html lang="ja"> <head> <meta charset="Shift_JIS"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <meta http-equiv="Content-Style-Type" content="text/css"> <title>財務会計コアシステム</title> <link rel="stylesheet" href="<%= ctxPath %>/style/global.css"> <%-- <link rel="stylesheet" href="<%= ctxPath %>/style/body_global.css"> --%> <style> /* メッセージ */ .info-icon { display: inline-block; width:20px; height:20px; background-image : url(../image/msg_info.gif); margin-right: 3px; } .info-text { color : blue; font-weight: bold; } .warn-icon { display: inline-block; width:20px; height:20px; background-image : url(../image/msg_alert.gif); margin-right: 3px; } .warn-text { color : tomato; font-weight: bold; } .errors-icon { display: inline-block; width:20px; height:20px; background-image : url(../image/msg_error.gif); margin-right: 3px; } .errors-text { color : red; font-weight: bold; } .topBody { background-color: #EEEEEE; text-align: center; margin: 0; padding: 0 0 20px; } .topContainerInner { text-align: left; padding: 0 30px 30px; } .topContainerInner > div:first-child { padding-left: 450px; } .topContainerInner h1 { color: #fff; background : linear-gradient(120deg, rgba(1,62,125,1.00) 0%, rgba(8,89,171,1.00) 100%); border: 1px solid #024D99; border-radius: 6px; font-size: 15px; font-weight: normal; line-height: 1.3; letter-spacing: 1px; padding: 9px 20px 7px 0px; margin: 20px 0 10px; position: relative; padding-left: 28px; } .topContainerInner h1::before { content: ""; display: block; position: absolute; left: 15px; top: 50%; width: 8px; height: 8px; background-color: #ED6D00; border-radius: 1px; margin: -4px 0 0 0; } .topHeaderTitle { margin: 0; padding: 18px 70px 14px; line-height: 1; color: #fff; font-weight: 500; font-size: 27px; border-top: none; border-radius: 0 0 10px 10px; display: inline-block; background : linear-gradient(180deg, rgba(1,43,98,1.00) 0%, rgba(16,72,145,1.00) 100%); letter-spacing: 3px; font-family: Arial, Helvetica, "sans-serif"; } .topHeaderDate { width: 159px; height: 43px; /*background-color: #f0f8ff;*/ /* 背景色 */ /*border: 0.5px solid #4682b4;*/ /* ?框 */ border-radius: 20px; display: flex; align-items: center; justify-content: center; font-family: Arial, Helvetica, "sans-serif"; /*color: #333;*/ text-align: right; margin-top: 50px; border: 1px solid #5483BA; font-size: 14px; color: #074D99; border-radius: 100px; line-height: 1; background-color: #F6F6F6; } .topHeaderDate:before { /*content: "\f073";*/ font-family: FontAwesome; margin-right:10px; color: #EB7D42; } .login-container { width: 900px; margin: 7px auto; padding: 30px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); border-radius: 8px; background-color: #fff; } .login-header { text-align: center; margin-bottom: 20px; } .login-form div { margin-bottom: 6px; display: flex; align-items: center; } .login-form label { width: 120px; margin-right: 10px; text-align: right; } .login-form input[type="text"], .login-form input[type="password"] { flex: 1; padding: 10px; box-sizing: border-box; } .login-form input[type="submit"]:hover { background-color: #0056b3; } .login-message { color: red; margin-bottom: 15px; } .password { padding-left: 20px; } .okButton { width: 200px; height: 34px; background: linear-gradient(180deg, rgba(1,62,125,1.00) 0%, rgba(2,77,153,1.00) 100%); } .quitButton { width: 200px; height: 34px; color: #024D99; background : linear-gradient(180deg, rgba(236,236,236,1.00) 0%, rgba(246,246,246,1.00) 90%); } .passButton { width: 115px; height: 29px; color: #024D99; background : linear-gradient(180deg, rgba(236,236,236,1.00) 0%, rgba(246,246,246,1.00) 90%); } .loginFormData { flex-direction: column; /*padding: 20px 10px 0;*/ } .loginFormData dt { font-size: 20px; color: #024D99; float: left; width: 150px; padding: 20px 10px 0; } .loginFormData dd { margin: 0; padding: 10px 10px 10px 150px; } .loginFormData .ErrorMessage{ padding: 1px 0; } .loginFormData.changePwData dt { width: 240px; } .loginFormData.changePwData dd { padding: 10px 10px 10px 240px; } .btnTopLogin, .btnTopQuit, .btnChangePw, .btnTopPW, .topHeaderMenu a, .btnLatestSituation, .bt_sub { -moz-transition: background-color 0.3s; -o-transition: background-color 0.3s; -webkit-transition: background-color 0.3s; transition: background-color 0.3s; width: 120px; } .btnTopLogin:hover, .btnTopPW:hover, .bt_sub:hover, .topHeaderMenu a:hover { opacity: 0.7; } /*.btnTopLogin, .btnTopPW { color: #fff; font-size: 20px; background : linear-gradient(180deg, rgba(1,62,125,1.00) 0%, rgba(2,77,153,1.00) 100%); border-top-color: #3E70AF; border-left-color: #3E70AF; } .btnTopQuit { border: 1px solid #07336A; border-top-color: #3E70AF; border-left-color: #3E70AF; color: #024D99; font-size: 20px; background : linear-gradient(180deg, rgba(236,236,236,1.00) 0%, rgba(246,246,246,1.00) 90%); } .btnTopQuit:before { content: "\f00d"; font-family: FontAwesome; margin-right: 10px; font-weight: normal; font-size: 22px; }*/ .loginFormBtn { list-style: none; margin: 20px; padding: 0; display:flex; justify-content:center; column-gap: 20px; } .loginFormBtn li { margin: 5px; } .cautionList { list-style: none; margin: 0px 0; padding: 0; font-size: 14px; color: #144D67; } .cautionList > li { margin: 0 0 0 5px; padding: 0 0 0 18px; text-indent: -18px; } </style> </head> <% Date now = new Date(); String historicalTime = StringUtil.seirekiToWareki(now, "1"); %> <body onLoad="event_onLoad()" class="topBody"> <div class = "topContainerInner"> <div> <div class = "topHeaderTitle">財務会計コアシステム</div> </div> <div style = "text-align: right; padding-left: 1244px;"> <div class = "topHeaderDate"><%= historicalTime%></div> </div> <div class="login-container"> <div class="login-header"> <div style="text-align: left;"> <h1>ログイン</h1> </div> </div> <%-- <form name="myLogin" method="POST" action="<%= ctxPath %>/page/login.jsp"> --%> <form name="myLogin" action="<%=request.getContextPath() %>/servlet/EntryServlet" method="POST"> <input type="hidden" name="action" value="dologin"> <% if(pAction == null) { msg = null; msgType = 0; focusFieldName = "user"; } String msgArea = null; String msgIcon = null; String msgText = null; switch(msgType) { case MSGTYPE_INFO: msgArea = "info"; msgIcon = "info-icon"; msgText = "info-text"; break; case MSGTYPE_WARN: msgArea = "warn"; msgIcon = "warn-icon"; msgText = "warn-text"; break; case MSGTYPE_ERR: msgArea = "errors"; msgIcon = "errors-icon"; msgText = "errors-text"; break; default: msgArea = null; msgIcon = null; msgText = null; break; } %> <div class="<%= msgArea %> login_message" style="text-align:center"> <% if(msgIcon != null) { %> <i class="<%= msgIcon %>"></i> <% } //if msgIcon %> <% if(msg != null) { %> <span class="<%= msgText %>"><%= EscapeUtils.escapeHtml(msg) %></span> <!-- <br/>  --> <% } //if msg %> </div> <div class="login-form"> <div class="loginFormData"> <div> <div style = "padding-right: 56px"> <label for="user" style="color: #024D99;font-size: 15px;">ユーザID</label> </div> <div style = "padding-right: 127px"> <input id="user" type="text" name="user" maxlength="10" style="ime-mode:disabled;height: 30px;border-radius: 5px;"> </div> <div class = "password"> </div> </div> <div> <div style = "padding-right: 44px"> <label for="pass" style="color: #024D99;font-size: 15px;">パスワード</label> </div> <div> <input id="pass" type="password" name="password" maxlength="20" style="height: 30px;border-radius: 5px;"> </div> <div class = "password"> <input type="submit" value="パスワード変更" class="passButton" style="height: 27px;"> </div> </div> </div> <svg width="100%" height="10"> <line x1="160" y1="5" x2="87%" y2="5" stroke="black" stroke-width="0.5" stroke-dasharray="5,1" /> </svg> <div class = "loginFormBtn"> <div class="btnTopLogin"> <input type="submit" value="OK" class="okButton"> </div> <div class="btnTopQuit"> <input type="submit" value="QUIT" class="quitButton"> </div> </div> <svg width="100%" height="10"> <line x1="5" y1="5" x2="100%" y2="5" stroke="black" stroke-width="0.5" stroke-dasharray="5,1" /> </svg> <div class="cautionList" > <div style="margin-left:100px;"> <li style=" padding-left: 69px;font-size: 12px;">※財務会計システムでは誤作動防止のため、以下のブラウザ標準機能を制御しておりますのでご注意ください。 <br> ・マウス操作による右クリック・メニューが表示されません。<br> ・キーボードのBS(バックスペース)キーで前画面に戻れません。<br> ※操作に関するご質問については、下記ヘルプデスクまでお問い合わせください。<br> ※ユーザID、パスワードがご不明な方は下記問い合わせフォームにてお問い合わせください。 </div> </div> <svg width="100%" height="10"> <line x1="5" y1="5" x2="100%" y2="5" stroke="black" stroke-width="0.5" stroke-dasharray="5,1" /> </svg> <div class="cautionList" > <div style="margin-left:100px;"> <li style=" padding-left: 69px;font-size: 12px;"> [財務会計コアシステム サポート担当]  00-1234-5678</li> </div> </div> <div style="width: 100%;display:flex;"> <div style="width: 50%;text-align:left;margin-left:50px;font-size:12px "> Ver.1.0.1 </div> <div style="padding-left:258px;font-size:12px"> 画面ID:○○○○1 </div> </div> </ul> </div> <input type="hidden" name="WPKEY" value="<%=strWpkey %>"> <input type="hidden" name="DISP_MODE" value="login"/> <input type="hidden" name="LOGIN_MODE" value="<%=strLoginMode %>"> </form> </div> </div> <script> function event_onLoad() { try { var focusFieldName = "<%= EscapeUtils.escapeJavaScriptIncludesSlash(focusFieldName) %>"; var focusControl = document.forms[0].elements[focusFieldName]; if (focusControl) { focusControl.focus(); } } catch (e) {} } </script> </body> </html>
09-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值