title: Auto login with j_security_check
body: <p>I am new to j_security_check tomcat. However i implemented login functionality(form based authentication) using login filter &amp; some settings in web.xml. When we trying to access a secured page, tomcat redirects to login page. After providing credentials it redirects user to a page which user tried to access. So far it is working as expected.</p>
  
  <p>But, the new requirement is:
  User access a non-secured page (public page), there he can enter his login username &amp; login password. On submitting this page we have to do</p>
  
  <ol>
  <li>create a user with details provided by the user(save to DB) </li>
  <li>auto login the user and redirect to a secured home page.</li>
  </ol>
  
  <p>the 1st point has already been implemented and working fine. After inserting new user i am redirecting to secured home page. Then container shows a login page where user can enter his credentials, the submit action of login page takes user to secured page.</p>
  
  <p>But i want to redirect user to secured home page after saving his details to DB as we have his username &amp; password i.e. non-secured page to secured page without login page interruption. I want to use container managed authentication only.</p>
  
  <p>Any ideas??</p>
  
  <p>Thanks in advance.</p>