title: j_security_check always return fail
body: <p>I've try to done a assignment at school. But, I'm facing problem.</p>
  
  <p>j_security_check alway return fail. I've try to google many document. but it couldn't solve this.</p>
  
  <p>Anyone has some idea? And how to redirect new page after login, now i can see i could response only a text. </p>
  
  <p>maybe i wrong at <code>&lt;realm-name&gt;UserDatabase&lt;/realm-name&gt;</code>, but i dont know how to change it.</p>
  
  <p>Thanks for your reading,.  </p>
  
  <p><strong>Login.html file:</strong></p>
  
  <pre><code>&lt;form id="login" method="post" action="j_security_check" &gt;
          &lt;input name="j_username" type="text" value="123"&gt;
          &lt;input name="j_password" type="text" value="123"&gt;
          &lt;input type="submit" value="Login" /&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p><strong>LoginType.java</strong></p>
  
  <pre><code> protected void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
      //        processRequest(request, response);
      response.setContentType("text/html;charset=UTF-8");
      PrintWriter out = response.getWriter();
      try {
          out.println("Success");
      } finally {
          out.close();
      }
  }
  </code></pre>
  
  <p><strong>web.xml file:</strong></p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Logintype&lt;/servlet-name&gt;
      &lt;servlet-class&gt;Logintype&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Logintype&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/Logintype&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;security-constraint&gt;
      &lt;web-resource-collection&gt;
          &lt;web-resource-name&gt;Vaadin application&lt;/web-resource-name&gt;
          &lt;url-pattern&gt;/Logintype&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
      &lt;auth-constraint&gt;
          &lt;role-name&gt;users&lt;/role-name&gt;
      &lt;/auth-constraint&gt;
  &lt;/security-constraint&gt;
  &lt;login-config&gt;
      &lt;auth-method&gt;FORM&lt;/auth-method&gt;
      &lt;realm-name&gt;UserDatabase&lt;/realm-name&gt;
      &lt;form-login-config&gt;
          &lt;form-login-page&gt;/Login.html&lt;/form-login-page&gt;
          &lt;form-error-page&gt;/Fail.html&lt;/form-error-page&gt;
      &lt;/form-login-config&gt;
  &lt;/login-config&gt;
  &lt;session-config&gt;
      &lt;session-timeout&gt;
          30
      &lt;/session-timeout&gt;
  &lt;/session-config&gt;
  </code></pre>
  
  <p><strong>tomcat-user.xml file:</strong></p>
  
  <pre><code>&lt;tomcat-users&gt;
  &lt;role rolename="tomcat"/&gt;
   &lt;role rolename="role1"/&gt;
   &lt;role rolename="users"/&gt;
   &lt;user username="123" password="123" roles="users"/&gt;
   &lt;user username="tomcat" password="tomcat" roles="tomcat"/&gt;
   &lt;user username="both" password="tomcat" roles="tomcat,role1"/&gt;
   &lt;user username="role1" password="tomcat" roles="role1"/&gt;
    &lt;/tomcat-users&gt;
  </code></pre>
  
  <p><strong>server.xml</strong> </p>
  
  <pre><code>  &lt;Realm className="org.apache.catalina.realm.LockOutRealm"&gt;
      &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/&gt;
    &lt;/Realm&gt;
  </code></pre>