@Named
@RequestScoped
@URLMapping(id = "unblock", pattern = "/unblock", viewId = "/unblock.xhtml")
public class Unblock {
@URLAction
public void load(){
//initialize some values..
}
public void sendRequest(){
}
并在 xhtml 文件中;
<h:commandButton id="submit action="#{unblockAccount.sendRequest}"
现在,当第一次加载页面时,我的加载方法被正确调用,但是当我单击页面上的提交按钮并调用“sendRequest”方法时,再次调用加载方法。
我怎样才能阻止这个?我也尝试使用@ViewScope,但没有帮助