【发布时间】:2008-12-29 18:18:12
【问题描述】:
我有一个在 Tomcat 5.5.27 和 5.5.26 上运行的 servlet,并且有一个带有 POST 方法的 Web 表单。 如果我使用 Safari 3.2.1,我会从日志中看到 Tomcat 收到一个 POST 后立即/同时是 GET 并且它失败了。 如果我使用 Firefox 3.0.5,我发现它只发送 POST 并且一切正常。
尝试使用 Eclipse 进行调试,我看到使用 Safari 时调用的是 doGet() 方法,而使用 Firefox 时调用的是 doPost()。
实际上,Safari 似乎同时触发 POST,然后立即 GET,而 Firefox 只触发 POST(根据 HTML 表单应该如此)。
还有其他人经历过这种情况吗?这种情况有解决办法吗?
这是 HTML 表单的 sn-p:
<form action="/vidisearch/Search" method="post" name="SearchForm" id="SearchForm">
<div class="input required">
<label for="Concepts">Concepts, comma separated<br />
ex. (remove quotes) "man-made object, cemetery, graphic event, atmospheric event, tool event"</label>
<input name="concepts" type="text" value="" id="concepts" />
</div>
<div class="input required">
<label for="Operators">Operators, comma separated<br />
ex. (remove quotes) "NOT, AND, OR, AND, AND"</label>
<input type="text" name="operators" value="" id="operators" />
</div>
<div class="input required">
<label for="Specializations">Specializations, comma separated<br />
ex. (remove quotes) "true, false, false, true, false"</label>
<input type="text" name="specializations" value="" id="specializations" />
</div>
<div class="input required">
<label for="Results">Various parameters</label>
<table width="100%" border="0" style="border: 0;">
<tr>
<td>Ontology ID<br />
<input name="ontologyID" type="text" id="ontologyID" value="" /></td>
<td>Result page<br />
<input name="page" type="text" id="page" value="0" /></td>
<td>Shots per page<br />
<input name="shotsPerPage" type="text" id="shotsPerPage" value="20" /></td>
<td>New search<br />
<input name="newSearch" type="text" id="newSearch" value="true" /></td></tr>
</table>
</div>
<div class="submit"><input type="submit" value="Search" /></div>
</form>
【问题讨论】:
标签: forms post safari get tomcat5.5