tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashok Venkat <ashok...@yahoo.com>
Subject j_security_check
Date Sun, 03 Feb 2008 03:38:29 GMT
Hi,
        I have the following code in a scheduler class, which is trying to invoke a servlet

 String url = "https://localhost:8444/servlet/TestServlet";

            // Get HTTP client instance
            HttpClient httpClient = new HttpClient();
            // Create HTTP GET method and execute it

            GetMethod getMethod = null;
            PostMethod postMethod = null;

            int int_result = 0;
            getMethod = new GetMethod( url );
            getMethod.setFollowRedirects(true);
            int_result = httpClient.executeMethod( getMethod );
            String contents = getMethod.getResponseBodyAsString();
            getMethod.releaseConnection();

            postMethod = new PostMethod( "https://localhost:8444/j_security_check" );
            postMethod.addParameter( "j_username",  "test" );
            postMethod.addParameter( "j_password", "test" );
            int_result = httpClient.executeMethod( postMethod );
            contents = postMethod.getResponseBodyAsString();
            postMethod.releaseConnection();

            postMethod = new PostMethod( url );
            postMethod.addParameter( "Password", "foo" );
            int_result = httpClient.executeMethod( postMethod );

---------->    At this point when the test servlet is called, the parameter password is
null. 
                     getParameter always returns null
                     getMethod returns GET when it should be post 
                    It seems that the  POST is behaving like a GET. 

This code works just fine on tomcat 5.0. After upgrading to 6.0, i am seeing this bizarre
behaviour

Any thoughts?


      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message