title: jsf commandButton does not call method from bean
body: <p>I checked a dozen of answers on similar question to this one, but none helped me solve the issue.</p>
  
  <p>Here is the body .xhtml file, where logout button does not work. This page is shown after login, if that is relevant.</p>
  
  <pre><code>&lt;body&gt;
  &lt;h:form id="newTaskForm"&gt;
  &lt;center&gt;
   &lt;p:commandButton value="Logout" action="#{LogoutController.logout}"/&gt;
   &lt;/center&gt;
   &lt;p:panel id="panel" header="New task" style="margin-bottom:20px"&gt;
      &lt;h:panelGrid id="grid" cellpadding="5" columns="3" style="margin-bottom:10px"&gt;
      &lt;f:facet name="header"&gt;
          &lt;p:messages id="msgs" /&gt;
      &lt;/f:facet&gt;
      form stuff, this is ok
      &lt;p:commandButton action="#{createNewTaskController.saveTask}"
          value="Spremi zadatak" update="newTaskForm" /&gt;
              &lt;/h:panelGrid&gt;
              &lt;/p:panel&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p></p>
  
  <p>and here is a bean:</p>
  
  <pre><code>@SessionScoped
  @ManagedBean
  public class LogoutController {
  
  public String logout() {
  
      HttpSession session = (HttpSession) FacesContext.getCurrentInstance()
              .getExternalContext().getSession(true);
      session.invalidate();
  
      return "/createNewTask.xhtml?faces-redirect=true";
  }
  
  }
  </code></pre>
  
  <p>I've seen a list of possible reasons why it could not work, but I can't really tell what an actual reason is, so I'd be grateful for any help</p>