title: JSF 2: Prevent share managed bean between session users login
body: <p>I have a trouble about using property in managed bean JSF 2.0.</p>
  
  <ol>
  <li><p>display.xhtml</p>
  
  <pre><code>&lt;p:commandButton value="Show" actionListener="#{ABean.ajaxShow}" update="info" /&gt;
  &lt;p:commandButton value="Hide" actionListener="#{ABean.ajaxHide}" update="info" /&gt;
     &lt;p:outputPanel id="info"&gt;
      &lt;p:fieldset rendered="#{ABean.show}"&gt;
         Info
      &lt;/p:fieldset&gt;
  &lt;/p:outputPanel&gt;
  </code></pre></li>
  <li><p>ABean.java</p>
  
  <p>@Named("ABean")</p>
  
  <p>public class ABean {
      private boolean show;</p>
  
  <pre><code>public void ajaxShow() {
      show = true;
  }
  
  public void ajaxHide() {
      show = false;
  }
  
  //getter setter
  </code></pre>
  
  <p>}</p></li>
  </ol>
  
  <p>This project is setup spring security 3.1.2 and manage user system.</p>
  
  <p>When there are 2 user login and open this page, user 1 click Show button, then 'Info' is displayed. So when user 2 go to this page, he'll see info displayed. If user 2 click Hide button, info is hide. Refresh this page which user 1 visit, info is hide. </p>
  
  <p>That's strange. I need the page user 1 visit only change info state (show/hide) when user 1 click button, not cause by user 2 on user2's page.</p>
  
  <p>I think it happens because 2 session of 2 user only use 1 managed bean instance. How can I do for this case? Please help me to resolve, thank you!</p>
  
  <p>PS: I try to add @SessionScoped, @ViewScoped, @RequestScoped for ABean but nothing change.</p>