【目的】
・クリックするボタンによって遷移する画面を変えたい
【実装方法】
①<head>の中に以下のscriptを記載
form.jsp
<head>
<script type="text/javascript">
function goServletB(){
document.getElementById('form').action="ServletBのパス";
}
function goServletC(){
document.getElementById('form').action="ServletCのパス";
}
</script>
</head>
②<body>の中に以下のhtmlを記載
form.jsp
<body>
<form id='form' name='form' action="servletAのパス">
<input type="submit" value="A" >
<input type="submit" value="B" onclick="goServletB();" >
<input type="submit" value="C" onclick="goServletC();>
</form>
</body>