Dear ALL, yea, i found it...the thing is "setFollowRedirects(false)" doesn't work for the java1.3.(the said method will only work with java1.2). so we have to use the "HttpURLConnection.setFollowRedirects(false);" before opening the httpurl itself...now it is giving the cookies as expected....I am very happy that, in future people won't feel this pain of finding, this said bug with java1.3. fine... but now the problem is "I cant able to find my servlet program(in the domino server), getting executed....hope the way, i call my servlet file from my client machine(after getting authenticated) is correct...."
This is my java program: ################### import java.io.*; import java.net.*;
public class authen { public static void main(String args[]) throws Exception { String cookie = ""; try { URL theurl = new URL("http://192.168.10.55:8001/names.nsf?login&username=sakthivel&passw ord=12345"); HttpURLConnection.setFollowRedirects(false); HttpURLConnection hurl = (HttpURLConnection)(theurl.openConnection()); hurl.connect();
int ic=0; String key=""; while (ic<=10) { key = hurl.getHeaderFieldKey (ic); if(ic<=10) { String value = hurl.getHeaderField (ic++); System.out.println(key + " - " + value); } }
The output for the above program: *************************** null - HTTP/1.1 302 Found Server - Lotus-Domino/0 Date - Tue, 11 Jun 2002 08:26:01 GMT Location - http://192.168.10.55:8001/ Connection - close Content-Type - text/html Set-Cookie - DomAuthSessId=0E256929C558C1E725264E4A25F94FF8; path=/ null - null null - null null - null null - null cookie is - DomAuthSessId=0E256929C558C1E725264E4A25F94FF8; path=/
P.S: The problem is : the servlet is not getting executed....is there anything wrong with the way of sending my cookie, while calling the servlet file(in the domino server)...