I have primefaces tab with spring boot. Each tab has a individual datatable which shares common instance variable "name".
Example: User1 selected name as "John" in tab1
User2 selected name as "Sam" in tab2
My expectation is User1 should have "John", not "Sam" once user2 selects "Sam" in UI.
My bean:
@Named("myBean")
@ViewScoped
class MyBean {
private String name;
//getter and setter for name
}
I am not sure if this anything to do with spring boot.
Please help, I have zero clue on this issue.
Solved the issue with below code
@Named("myBean")
@ViewScoped
@Component
@Scope(value = WebApplicationContext.SCOPE_SESSION)
class MyBean {
private String name;
//getter and setter for name
}