简体   繁体   中英

JSF 2.0 managedbeans problem!

ı have a problem about jsf 2.0 managedbeans. the problem is that, ı create two objects in my managedbean and when ı set the data of one of them the other changes. the following code show the problem,

@ManagedBean(name = "mainn")

@ViewScoped

public class Mainn {

 private  AyniAndaDoğrusalIkiliHareket one = new AyniAndaDoğrusalIkiliHareket();

 private  AyniAndaDoğrusalIkiliHareket two = new AyniAndaDoğrusalIkiliHareket();

    public void Hesapla() {

          one.setX2(5); 

          System.out.println(two.getX2()); // printf 5 the value of "one" 

       }

}

How can ı solve it ?

AyniAndaDoğrusalIkiliHareket声明您的x2成员不是 static的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM