title: Faces Bean Validation doesn't work on Glassfish 3.1.1
body: <p>I've used bean validation in a request scoped managed bean.</p>
  
  <pre class="lang-java prettyprint-override"><code>@ManagedBean(name = "loginController")
  @RequestScoped
  public class LoginController implements Serializable {
  
  private static final long serialVersionUID = -7174581953062231554L;
  
  @NotNull(message = "Password!")
  private String mPassword;
  
  @NotNull
  private String mUsername;
  ...
  ...
  public String login() {
      ..
      return "destination.xhtml";
  }
  </code></pre>
  
  <p>..and in the web.xml I've configured this as well for interpreting empty strings as null value:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;context-param&gt;
      &lt;param-name&gt;javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL&lt;/param-name&gt;
      &lt;param-value&gt;true&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>The view is looking like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:form id="login"&gt;
      &lt;h3&gt;&lt;h:outputText value="Username" /&gt;&lt;/h3&gt;
      &lt;h:inputText id="username" value="#{loginController.username}" /&gt;
      &lt;h3&gt;&lt;h:outputText value="Password" /&gt;&lt;/h3&gt;
      &lt;h:inputSecret id="password" value="#{loginController.password}" autocomplete="off" /&gt;
      &lt;h:commandButton id="submit" value="Login" action="#{loginController.login}"&gt;
          &lt;f:param name="redirect" value="#{requestScope['javax.servlet.forward.request_uri']}" /&gt;
      &lt;/h:commandButton&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>Environment: Glassfish 3.1.1 / Mojarra JSF 2.1</p>
  
  <p>The problem: When the submit button without to fill out the username or password field is pressed, the action will be executed, though the annotation (@javax.validation.constraints.NotNull) should prevent this. The validation doesn't work!
  Adding the attribute "required" to the fields will solve this problem, but I don't want the validation logic in the view.
  Do you have any advice for me?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Basically, the code above works. I tested it in a separate project.
  In the other project, which still not working, is something different. The form is configured as login form (login-config) in the web.xml file. Does this make some changes in the jsf life cycle? ..or something other? </p>