いつもお世話になっております。
今回はJSP→servletへの画面遷移についての質問です。
jsp側では画面としてユーザー側の入力
servletではDBへ登録してあるデータの判別 この2点を行いたいです。
※私の中ではservletへの受け渡し部分であるactionに改善点があると思いますが、うまく改善できません。
jsp
<html> <head> <!-- css外部ファイル化 --> <style type="text/css"> @import url("style.css") ; </style> <!-- js外部ファイル化 --> <script type="text/javascript" src="script.js"></script> <!-- 数値の連結 --> <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> <script> $(function(){ $('input[type=button]').click(function(){ if ($('#text').val().length < 4) { $('#text').val($('#text').val() + $(this).val()); } }); }); </script> </head> <!-- キーボード入力不可 --> <body onkeydown="return false;"> <div id="Numtitle">暗証番号を入力してください。</div> <!--actionの操作要見当 --> <form method ="post" name="Form" onSubmit="return chValie()" action="/Pass_check"> <div id="title">暗証番号:<input type="text" id="text" name="pass" value="" onfocus="color1(this);"onblur="color2(this);" tabindex="1" title="4桁の暗証番号を入力してください。" ></div><br> <br><table> <div> <tr> <td><input type="button" value="7" id="7" tabindex="2" class="num-button" ></td> <td><input type="button" value="8" id="8" tabindex="3" class="num-button" ></td> <td><input type="button" value="9" id="9" tabindex="4" class="num-button" ></td> </tr> <tr> <td><input type="button" value="4" id="4" tabindex="5" class="num-button" ></td> <td><input type="button" value="5" id="5" tabindex="6"class="num-button" ></td> <td><input type="button" value="6" id="6" tabindex="7" class="num-button" ></td> </tr> <tr> <td><input type="button" value="1" id="1" tabindex="8" class="num-button" ></td> <td><input type="button" value="2" id="2" tabindex="9" class="num-button" ></td> <td><input type="button" value="3" id="3" tabindex="10" class="num-button" ></td> </tr> <tr> <td colspan="3"><input type="button" value="0" tabindex="11" name="zero"class="num-button"></td> </tr> </div> </table> </div> <div id="menu"> <table border="1"> <tr> <td width="33.3%;"><input type="submit" value="戻る" class="button" name="Back" tabindex="12"onclick="history.back()"></td> <td width="33.3%;"><input type="reset" value="訂正" class="button" name="Correction" tabindex="13"></td> <td width="33.3%;"><input type="submit" value="確認" class="button" name="Check" tabindex="14" ></td> <td width="33.3%;"><input type="submit" value="メインメニュー"class="button" name="Back" tabindex="15" onclick="location.href='Mainmenu.jsp'"></td> </tr> </table> </div> </form> </body> </html>以上です。