次のようなBeanクラスがあります。
static int variable_static;
public RestaurantBean() {
variable_static = 0;
}
//...
//value of variable_static changes throughout the code
//...
public string button() {
//firing this button causes the variable_static value to change back to 0
return null;
}
コード全体で値が変更される静的変数があります (値を出力することでわかります) が、ボタンが起動されると、その値は自動的にデフォルト値に戻りますが、これは望ましくありません。これは JSF のポストバックですか? どうすればこれを防ぐことができますか?