私はいくつかの入力フィールドを持つシンプルな jsp を持っています。ほとんどのブラウザーでは問題なく動作しますが、IE ではそれほどではありません。
フォームが IE で使用される場合、最初の送信のみが機能します。フォームからのパラメーターの一部が欠落しているため、その後のすべての送信は「失敗」します。これは、Chrome または Firefox では問題になりません。各送信の間にページをリロードすると、IE でも問題なく動作しますが、これはオプションではありません。
形:
<form id="form1" method="post" action="receiver.htm">
<table>
<tr id="name">
<td>Name</td>
<td><input id="input_name" name="name"/></td>
</tr>
<tr>
<td>Amount</td>
<td><input id="amount" name="amount" type="text"/></td>
</tr>
<tr>
<td>Unit</td>
<td><input id="unit" name="unit" type="text"/></td>
</tr>
<tr>
<td colspan="2"><input id="submit_button" type="submit" value="submit"/></div>
</td>
</tr>
</table>
</form>
コントローラ:
@RequestMapping(value = "/receiver.htm", method = RequestMethod.POST)
@ResponseBody public String receive(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
String name = httpServletRequest.getParameter("name");
String amount = httpServletRequest.getParameter("amount");
UnitType unit = UnitType.getValue(httpServletRequest.getParameter("unit"));
}
UnitType は私が作った列挙型です。また、一部のパラメーターが null として返されるため、IE での 2 回目の送信後に次の例外がスローされます。
java.lang.NullPointerException: Name is null