Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
情况:
我怎样才能防止这种行为?
两种方式:
使用 ajax 执行操作(这不会生成浏览器历史记录)。
<h:commandButton ...> <f:ajax execute="@form" render="@form" /> </h:commandButton>
发布后发送重定向(称为 POST-Redirect-GET 模式)。
public String save() { // ... return "sameview?faces-redirect=true"; }