title: p:commandButton results in an IllegalStateException
body: <p>I get this error when I click on a p:commandButton in my page</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: PWC3999: Cannot create a session
    after the response has been committed</p>
  </blockquote>
  
  <p>The button is in an h:form and looks like this:</p>
  
  <pre><code>&lt;p:commandButton value="Save" action="#{discussionManager.save}" ajax="false"/&gt;  
  </code></pre>
  
  <p>But an h:commandButton works fine:</p>
  
  <pre><code>&lt;h:commandButton value="Save" action="#{discussionManager.save}"/&gt;  (this works)
  </code></pre>
  
  <p>This is the bean with the method in it</p>
  
  <pre><code>@Named
  @RequestScoped
  public class DiscussionManager {
  
      private static final Logger logger = Logger.getLogger("DiscussionManager");
  
      @Inject
      private DiscussionDao discussionDao;
  
      private Discussion discussion = new Discussion();
  
      @Produces
      @Named
      @RequestScoped
      public Discussion getDiscussion() {
          return discussion;
      }
  
      public String save() {
          logger.info("Hello");
          discussionDao.create(discussion);
          return "list";
      }
  }
  </code></pre>
  
  <p>I've waited all day before posting this question because I feel like I should know how to get this working. But I've read and re-read my book, and loads of other posts. I just don't understand why it's not working. </p>