title: Programmatically using j_security_check
body: <p>I have page like localhost:7001/MyServlet. I am making a http connection request from like below</p>
  
  <pre><code>String url = "http://localhost:7001/MyServlet"
  PostMethod method = new PostMethod(url); 
  HttpClient client = new HttpClient();
  </code></pre>
  
  <p>However "MyServlet" is protected by j_security_check. So when I am making my connection , getting redirected to login page.</p>
  
  <p>How to get authenticated and access my url , in one HttpConnection</p>
  
  <p>Note: I use apache common httpclient</p>
  
  <pre><code>import org.apache.commons.httpclient.HttpClient; 
  import org.apache.commons.httpclient.methods.PostMethod;
  </code></pre>